From 2217e86706fcaf03da2c05761b4f837e90374ec2 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 14 May 2025 11:37:01 +0700 Subject: fix bug --- indoteknik_custom/models/product_template.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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' -- cgit v1.2.3