diff options
| -rw-r--r-- | indoteknik_custom/models/barcoding_product.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/indoteknik_custom/models/barcoding_product.py b/indoteknik_custom/models/barcoding_product.py index 17057d1d..353f94d5 100644 --- a/indoteknik_custom/models/barcoding_product.py +++ b/indoteknik_custom/models/barcoding_product.py @@ -19,12 +19,11 @@ class BarcodingProduct(models.Model): @api.constrains('barcode') def _send_barcode_to_product(self): for record in self: - if record.barcode and not record.product_id.barcode: - if record.type == 'barcoding_box': - record.product_id.barcode_box = record.barcode - record.product_id.qty_pcs_box = record.qty_pcs_box - else: - record.product_id.barcode = record.barcode + if record.type == 'barcoding_box': + record.product_id.barcode_box = record.barcode + record.product_id.qty_pcs_box = record.qty_pcs_box + else: + record.product_id.barcode = record.barcode @api.onchange('product_id', 'quantity') def _onchange_product_or_quantity(self): |
