diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2025-01-14 09:31:44 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2025-01-14 09:31:44 +0700 |
| commit | 183cd9e68ea05e31c63000aeb992eb618edb02b5 (patch) | |
| tree | 45d710db372c2a0eba437a0137cbb74d9935a7f2 /indoteknik_custom/models/stock_move.py | |
| parent | 63878bd84a6eb9094e702963d7c78fcd8dfa1808 (diff) | |
| parent | 6dda865a1b3262ce78ed2db024fd03efb091d6a6 (diff) | |
Merge branch 'odoo-production' into feature/integrasi_biteship
# Conflicts:
# indoteknik_custom/__manifest__.py
# indoteknik_custom/models/__init__.py
# indoteknik_custom/security/ir.model.access.csv
Diffstat (limited to 'indoteknik_custom/models/stock_move.py')
| -rw-r--r-- | indoteknik_custom/models/stock_move.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py index ac2e3cc0..e1d4e74c 100644 --- a/indoteknik_custom/models/stock_move.py +++ b/indoteknik_custom/models/stock_move.py @@ -7,6 +7,27 @@ class StockMove(models.Model): line_no = fields.Integer('No', default=0) sale_id = fields.Many2one('sale.order', string='SO') + print_barcode = fields.Boolean( + string="Print Barcode", + default=lambda self: self.product_id.print_barcode, + ) + qr_code_variant = fields.Binary("QR Code Variant", compute='_compute_qr_code_variant') + + def _compute_qr_code_variant(self): + for rec in self: + if rec.print_barcode and rec.print_barcode == True and rec.product_id and rec.product_id.qr_code_variant: + rec.qr_code_variant = rec.product_id.qr_code_variant + else: + rec.qr_code_variant = False + + + def write(self, vals): + res = super(StockMove, self).write(vals) + if 'print_barcode' in vals: + for line in self: + if line.product_id: + line.product_id.print_barcode = vals['print_barcode'] + return res def _do_unreserve(self, product=None, quantity=False): moves_to_unreserve = OrderedSet() |
