summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/res_users.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-03-05 14:02:13 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-03-05 14:02:13 +0700
commit006c1171970a3ade5033d8bb112b7f6094b35d11 (patch)
treeff11743c553ebb6682b0640171318d9b322d427c /indoteknik_custom/models/res_users.py
parent660913a45a1efe08f308d405e1011efc9744c553 (diff)
parent92b6da28414fed56732f86e1f04ea2fac3464d7d (diff)
Merge branch 'odoo-production' into dev/wms
# Conflicts: # indoteknik_custom/models/__init__.py # indoteknik_custom/models/stock_immediate_transfer.py # indoteknik_custom/models/stock_picking.py
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):