summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-08-30 10:33:01 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-08-30 10:33:01 +0700
commit76e97903641e6dc35f4158f2a08cfa70bed50afe (patch)
tree9ad558e312432641910a5d9a4281838b107bfd39
parent61c89397e839f546c796a596a1fbbc840aa85311 (diff)
change constraint product template
-rwxr-xr-xindoteknik_custom/models/product_template.py37
1 files changed, 2 insertions, 35 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 3352c6b0..c2cf3bb9 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -69,24 +69,7 @@ class ProductTemplate(models.Model):
# raise UserError("Hanya Pak Tyas yang bisa mengedit product")
# return super(ProductTemplate, self).write(vals)
- @api.constrains('name',
- 'default_code',
- 'sequence',
- 'responsible_id',
- 'list_price',
- 'standard_price',
- 'qty_available',
- 'virtual_available',
- 'uom_id',
- 'activity_exception_decoration',
- 'web_tax_id',
- 'categ_id',
- 'taxes_id',
- 'barcode',
- 'x_manufacture',
- 'x_model_product',
- 'x_studio_field_tGhJR',
- 'attribute_line_ids',)
+ @api.constrains('name','default_code',)
def _check_duplicate_product(self):
if not self.env.user.is_purchasing_manager:
for product in self:
@@ -364,23 +347,7 @@ class ProductProduct(models.Model):
# raise UserError("Hanya Pak Tyas yang bisa mengedit product")
# return super(ProductProduct, self).write(vals)
- @api.constrains('name',
- 'default_code',
- 'product_template_attribute_value_ids',
- 'lst_price',
- 'standard_price',
- 'qty_available',
- 'outgoing_qty',
- 'incoming_qty',
- 'virtual_available',
- 'web_tax_id',
- 'categ_id',
- 'taxes_id',
- 'barcode',
- 'x_manufacture',
- 'x_model_product',
- 'x_studio_field_tGhJR',
- )
+ @api.constrains('name','default_code',)
def _check_duplicate_product(self):
if not self.env.user.is_purchasing_manager:
for product in self: