diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-09-20 13:21:38 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-09-20 13:21:38 +0700 |
| commit | aeadcc9b170ae8585844d4b4986971ed028b7897 (patch) | |
| tree | f1d31704289a6a1b7edf65fa845d2d7057cd9b9e /indoteknik_custom/models/product_template.py | |
| parent | 03ccb219d927400af96c4b39add257e78864b7f2 (diff) | |
add new role user to edit product
Diffstat (limited to 'indoteknik_custom/models/product_template.py')
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 2ce2c185..7effc109 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -75,7 +75,7 @@ class ProductTemplate(models.Model): @api.constrains('name', 'default_code') def _check_duplicate_product(self): for product in self: - if not self.env.user.is_purchasing_manager: + if not self.env.user.is_purchasing_manager and not self.env.user.is_editor_product: domain = [('default_code', '!=', False)] if product.product_variant_ids: @@ -353,8 +353,8 @@ class ProductProduct(models.Model): @api.constrains('name','default_code') def _check_duplicate_product(self): - if not self.env.user.is_purchasing_manager: - for product in self: + for product in self: + if not self.env.user.is_purchasing_manager and not self.env.user.is_editor_product: if product.write_date == product.create_date: domain = [ ('default_code', '!=', False), |
