diff options
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 03c7ced4..17805c6c 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -1320,11 +1320,19 @@ class ProductProduct(models.Model): # simpan data lama dan log perubahan field def write(self, vals): - if self.default_code in vals: + tracked_fields = [ + 'default_code', 'name', 'weight', 'x_manufacture', + 'public_categ_ids', 'search_rank', 'search_rank_weekly', + 'image_1920', 'unpublished', 'image_carousel_lines' + ] + + if any(field in vals for field in tracked_fields): old_values = self._collect_old_values(vals) result = super().write(vals) self._log_field_changes_product_variants(vals, old_values) return result + else: + return super().write(vals) class OutstandingMove(models.Model): _name = 'v.move.outstanding' |
