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/barcoding_product.py | |
| parent | dceb69d104510bff6930ad0fe373dcf198417503 (diff) | |
fix bug
Diffstat (limited to 'indoteknik_custom/models/barcoding_product.py')
| -rw-r--r-- | indoteknik_custom/models/barcoding_product.py | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/indoteknik_custom/models/barcoding_product.py b/indoteknik_custom/models/barcoding_product.py index 5f4e80ea..335b481a 100644 --- a/indoteknik_custom/models/barcoding_product.py +++ b/indoteknik_custom/models/barcoding_product.py @@ -41,10 +41,8 @@ class BarcodingProduct(models.Model): @api.onchange('product_id', 'quantity') def _onchange_product_or_quantity(self): if self.product_id and self.quantity > 0: - # Clear existing lines self.barcoding_product_line = [(5, 0, 0)] - # Add a new line with the current product and quantity lines = [] for i in range(int(self.quantity)): lines.append((0, 0, { @@ -55,14 +53,12 @@ class BarcodingProduct(models.Model): self.barcoding_product_line = lines def write(self, vals): - """Override write to update sequence_with_total when quantity changes""" res = super().write(vals) if 'quantity' in vals and self.type == 'multiparts': self._update_sequence_with_total() return res def _update_sequence_with_total(self): - """Update sequence_with_total for all lines""" for rec in self: total = int(rec.quantity) for index, line in enumerate(rec.barcoding_product_line, start=1): |
