diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2024-08-14 15:28:23 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2024-08-14 15:28:23 +0700 |
| commit | 8de88de447f441f129c44e9a0c6f57dd27d40512 (patch) | |
| tree | 893da0ad7e4c4c376b37be98c901b3f991475aeb /indoteknik_custom/models/res_partner.py | |
| parent | c5e742d609ec379b6d0228f8274b3d97bda9214d (diff) | |
read only payment term
Diffstat (limited to 'indoteknik_custom/models/res_partner.py')
| -rw-r--r-- | indoteknik_custom/models/res_partner.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index 39faf9d3..0b9a3a6c 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -51,9 +51,14 @@ class ResPartner(models.Model): def write(self, vals): res = super(ResPartner, self).write(vals) - if 'property_payment_term_id' in vals: - if not self.env.user.is_accounting and vals['property_payment_term_id'] != 26: - raise UserError('Hanya Finance Accounting yang dapat merubah payment term') + # if 'property_payment_term_id' in vals: + # if not self.env.user.is_accounting and vals['property_payment_term_id'] != 26: + # raise UserError('Hanya Finance Accounting yang dapat merubah payment term') + + # group_id = self.env.ref('indoteknik_custom.group_role_merchandiser').id + # users_in_group = self.env['res.users'].search([('groups_id', 'in', [group_id])]) + # if self.env.user.id not in users_in_group.mapped('id'): + # raise UserError('You name it') return res |
