summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/res_users.py
diff options
context:
space:
mode:
authortrisusilo48 <tri.susilo@altama.co.id>2025-03-03 13:45:12 +0700
committertrisusilo48 <tri.susilo@altama.co.id>2025-03-03 13:45:12 +0700
commit887a0a83cd1ba53689d8c4b453761b94fa7e109b (patch)
treeab586cf196a454d17df70301bef6c4e714b5223a /indoteknik_custom/models/res_users.py
parent83d9fcaaae0ba04902d0010a801ccc2245834bab (diff)
parent7c675cd5bc9f45d2ebca33a63b7184cbb97f0f2f (diff)
Merge branch 'odoo-production' into feature/integrasi_biteship
# Conflicts: # indoteknik_custom/__manifest__.py # indoteknik_custom/models/sale_order.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):