summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-05-14 11:37:01 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-05-14 11:37:01 +0700
commit2217e86706fcaf03da2c05761b4f837e90374ec2 (patch)
tree7fee4be7d30870071940022f5bdd6b4326b4fa3d
parentc5506e8e7c22b02968d4a8ae56b7147ee85e686a (diff)
fix bug
-rwxr-xr-xindoteknik_custom/models/product_template.py10
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'