diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-04 11:50:40 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-04 11:50:40 +0700 |
| commit | 0d48eb39e2804780ca38a53090cd6ef46a5d346b (patch) | |
| tree | 4b07a2d187a8e2dc1f90df27098d8a0ad1d091ce /indoteknik_api/models/res_users.py | |
| parent | aaf2b91b6e888a30d12f123ccc91ed9061167763 (diff) | |
Fix get pricelist tier on user login API
Diffstat (limited to 'indoteknik_api/models/res_users.py')
| -rw-r--r-- | indoteknik_api/models/res_users.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/indoteknik_api/models/res_users.py b/indoteknik_api/models/res_users.py index 0fe9008b..4bc1e995 100644 --- a/indoteknik_api/models/res_users.py +++ b/indoteknik_api/models/res_users.py @@ -6,16 +6,9 @@ class ResUsers(models.Model): def api_single_response(self, res_user, with_detail=''): config = self.env['ir.config_parameter'] - product_pricelist_tier1 = int(config.get_param('product.pricelist.tier1')) - product_pricelist_tier2 = int(config.get_param('product.pricelist.tier2')) - product_pricelist_tier3 = int(config.get_param('product.pricelist.tier3')) user_pricelist = res_user.property_product_pricelist - user_pricelist_id = user_pricelist.id if user_pricelist else False - pricelist_tier = False - if user_pricelist_id == product_pricelist_tier1: pricelist_tier = 'tier1' - if user_pricelist_id == product_pricelist_tier2: pricelist_tier = 'tier2' - if user_pricelist_id == product_pricelist_tier3: pricelist_tier = 'tier3' + pricelist_tier = user_pricelist.get_tier_name() data = { 'id': res_user.id, |
