summaryrefslogtreecommitdiff
path: root/fixco_custom/models/product_product.py
diff options
context:
space:
mode:
Diffstat (limited to 'fixco_custom/models/product_product.py')
-rwxr-xr-xfixco_custom/models/product_product.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/fixco_custom/models/product_product.py b/fixco_custom/models/product_product.py
index bb3ba17..a6bec4d 100755
--- a/fixco_custom/models/product_product.py
+++ b/fixco_custom/models/product_product.py
@@ -18,6 +18,10 @@ class ProductProduct(models.Model):
barcode_box = fields.Char("Barcode Box")
qr_code_variant = fields.Binary("QR Code Variant", compute='_compute_qr_code_variant')
+ @api.constrains('name', 'default_code')
+ def constrains_product_type(self):
+ self.type = 'product'
+
def _compute_qr_code_variant(self):
for rec in self:
# Skip inactive variants