From c5506e8e7c22b02968d4a8ae56b7147ee85e686a Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 14 May 2025 11:24:04 +0700 Subject: fix bug --- indoteknik_custom/models/product_template.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indoteknik_custom/models/product_template.py') diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 2679fbfd..03c7ced4 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -1320,10 +1320,11 @@ class ProductProduct(models.Model): # simpan data lama dan log perubahan field def write(self, vals): - old_values = self._collect_old_values(vals) - result = super().write(vals) - self._log_field_changes_product_variants(vals, old_values) - return result + if self.default_code in vals: + old_values = self._collect_old_values(vals) + result = super().write(vals) + self._log_field_changes_product_variants(vals, old_values) + return result class OutstandingMove(models.Model): _name = 'v.move.outstanding' -- cgit v1.2.3