diff options
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): |
