summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/res_users.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-05-14 09:23:14 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-05-14 09:23:14 +0700
commitf120c760c6a837681ebed26d9eea33a8961cd1aa (patch)
tree728ecdd5ffd1530d97d58a9f18b850186b39aa67 /indoteknik_custom/models/res_users.py
parenta571531bd8626f9bee25e89c62bbd9268ed30597 (diff)
parent2469ee37cfe854f0419a8c3fbabed5bc32bcaa6e (diff)
Merge branch 'odoo-backup' into CR/form-merchant
# Conflicts: # indoteknik_custom/models/__init__.py # indoteknik_custom/security/ir.model.access.csv
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):