summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/models/product_template.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 13654ab3..6bd1acda 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -35,7 +35,8 @@ class ProductTemplate(models.Model):
solr_flag = fields.Integer(string='Solr Flag', default=0)
def write(self, vals):
- vals['solr_flag'] = 2
+ if not vals['solr_flag']:
+ vals['solr_flag'] = 2
return super().write(vals)
def _compute_qty_stock_vendor(self):
@@ -150,8 +151,9 @@ class ProductProduct(models.Model):
solr_flag = fields.Integer(string='Solr Flag', default=0)
def write(self, vals):
- self.product_tmpl_id.solr_flag = 2
- vals['solr_flag'] = 2
+ if not vals['solr_flag']:
+ self.product_tmpl_id.solr_flag = 2
+ vals['solr_flag'] = 2
return super().write(vals)
def _compute_web_price(self):