summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/res_users.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-02-25 14:01:15 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-02-25 14:01:15 +0700
commit6a5a2a2666c33ffafd610df882491d86918468bb (patch)
treeb61d4672169aa78a0bee9aae319af68768a2b6ee /indoteknik_custom/models/res_users.py
parent141bfb3a32e73d5b8557a70867d957d5ed3d485b (diff)
parenta24d7b2a21ff24e31eef77e2032a861b7eb13e31 (diff)
Merge branch 'odoo-production' into CR/renca-commision
# Conflicts: # indoteknik_custom/models/commision.py # indoteknik_custom/views/customer_commision.xml
Diffstat (limited to 'indoteknik_custom/models/res_users.py')
-rwxr-xr-xindoteknik_custom/models/res_users.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_custom/models/res_users.py b/indoteknik_custom/models/res_users.py
index 31b84ae3..b0864f2c 100755
--- a/indoteknik_custom/models/res_users.py
+++ b/indoteknik_custom/models/res_users.py
@@ -70,6 +70,10 @@ class ResUsers(models.Model):
vouchers = self.env['voucher'].get_active_voucher([('show_on_email', '=', 'user_activation')])
if not vouchers: return None
return ', '.join(x.code for x in vouchers)
+ if type == 'switch_account':
+ vouchers = self.env['voucher'].get_active_voucher([('excl_pricelist_ids', 'not in', [1]), ('apply_type', 'in', ['all', 'brand']), ('account_type', 'in', ['all', 'company']), ('visibility', 'in', ['public'])])
+ if not vouchers: return None
+ return ', '.join(x.code for x in vouchers)
return None
def check_access(self, model, mode):