summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/res_users.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-02-20 16:20:25 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-02-20 16:20:25 +0700
commit7c1c4def22a72b9a6f6806d70a865594ae14386c (patch)
tree3ffb388cf77f1b464bc454f5e25725424964ce7c /indoteknik_custom/models/res_users.py
parent38f8ddd9aaaad58c8d7ea27235cd109ba288693d (diff)
<iman> add CR voucher type account
Diffstat (limited to 'indoteknik_custom/models/res_users.py')
-rwxr-xr-xindoteknik_custom/models/res_users.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/res_users.py b/indoteknik_custom/models/res_users.py
index 31b84ae3..63942bb5 100755
--- a/indoteknik_custom/models/res_users.py
+++ b/indoteknik_custom/models/res_users.py
@@ -71,6 +71,13 @@ class ResUsers(models.Model):
if not vouchers: return None
return ', '.join(x.code for x in vouchers)
return None
+
+ def get_voucher_code_switch_account(self, type):
+ if type == 'switch_account':
+ vouchers = self.env['voucher'].get_active_voucher([('account_type', 'in', ['all','company'])])
+ if not vouchers: return None
+ return ', '.join(x.code for x in vouchers)
+ return None
def check_access(self, model, mode):
assert mode in ('read', 'write', 'create', 'unlink', 'import', 'export'), 'Invalid access mode'