diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-11-02 14:20:29 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-11-02 14:20:29 +0700 |
| commit | c5e1a624c8cc015d8fe457a90cd5bc3c7571b5eb (patch) | |
| tree | 0fffc4e55ab449ea69732893f28e9514fae557af | |
| parent | bf99a04f7c5530da790e25e67b9786ec0dffeb9b (diff) | |
Update product_template.py
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 33073e57..a812fc28 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -35,7 +35,7 @@ class ProductTemplate(models.Model): solr_flag = fields.Integer(string='Solr Flag', default=0) def write(self, vals): - if 'solr_flag' not in vals: + if 'solr_flag' not in vals and self.solr_flag == 1: vals['solr_flag'] = 2 return super().write(vals) @@ -151,7 +151,7 @@ class ProductProduct(models.Model): solr_flag = fields.Integer(string='Solr Flag', default=0) def write(self, vals): - if 'solr_flag' not in vals: + if 'solr_flag' not in vals and self.solr_flag == 1: self.product_tmpl_id.solr_flag = 2 vals['solr_flag'] = 2 return super().write(vals) |
