diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-14 11:24:04 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-14 11:24:04 +0700 |
| commit | c5506e8e7c22b02968d4a8ae56b7147ee85e686a (patch) | |
| tree | 07fa6cbe14fe4fcb9901c2479ee7914dc4738960 /indoteknik_custom/models/product_template.py | |
| parent | dceb69d104510bff6930ad0fe373dcf198417503 (diff) | |
fix bug
Diffstat (limited to 'indoteknik_custom/models/product_template.py')
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 9 |
1 files changed, 5 insertions, 4 deletions
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' |
