diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-03-05 14:02:13 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-03-05 14:02:13 +0700 |
| commit | 006c1171970a3ade5033d8bb112b7f6094b35d11 (patch) | |
| tree | ff11743c553ebb6682b0640171318d9b322d427c /indoteknik_custom/models/barcoding_product.py | |
| parent | 660913a45a1efe08f308d405e1011efc9744c553 (diff) | |
| parent | 92b6da28414fed56732f86e1f04ea2fac3464d7d (diff) | |
Merge branch 'odoo-production' into dev/wms
# Conflicts:
# indoteknik_custom/models/__init__.py
# indoteknik_custom/models/stock_immediate_transfer.py
# indoteknik_custom/models/stock_picking.py
Diffstat (limited to 'indoteknik_custom/models/barcoding_product.py')
| -rw-r--r-- | indoteknik_custom/models/barcoding_product.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/barcoding_product.py b/indoteknik_custom/models/barcoding_product.py index 6bbf9fde..e1b8f41f 100644 --- a/indoteknik_custom/models/barcoding_product.py +++ b/indoteknik_custom/models/barcoding_product.py @@ -12,6 +12,14 @@ class BarcodingProduct(models.Model): barcoding_product_line = fields.One2many('barcoding.product.line', 'barcoding_product_id', string='Barcoding Product Lines', auto_join=True) product_id = fields.Many2one('product.product', string="Product", tracking=3) quantity = fields.Float(string="Quantity", tracking=3) + type = fields.Selection([('print', 'Print Barcode'), ('barcoding', 'Add Barcode To Product')], string='Type', default='print') + barcode = fields.Char(string="Barcode") + + @api.constrains('barcode') + def _send_barcode_to_product(self): + for record in self: + if record.barcode and not record.product_id.barcode: + record.product_id.barcode = record.barcode @api.onchange('product_id', 'quantity') def _onchange_product_or_quantity(self): |
