diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-05-14 09:23:14 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-05-14 09:23:14 +0700 |
| commit | f120c760c6a837681ebed26d9eea33a8961cd1aa (patch) | |
| tree | 728ecdd5ffd1530d97d58a9f18b850186b39aa67 /indoteknik_custom/models/res_users.py | |
| parent | a571531bd8626f9bee25e89c62bbd9268ed30597 (diff) | |
| parent | 2469ee37cfe854f0419a8c3fbabed5bc32bcaa6e (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-x | indoteknik_custom/models/res_users.py | 4 |
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): |
