From 01d85b9f0d8fc70c35eaa13a154f3443fc35f1c6 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 18 Dec 2024 10:25:09 +0700 Subject: new field qr code variant --- indoteknik_custom/models/stock_move.py | 9 +++++++++ indoteknik_custom/views/stock_picking.xml | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py index 8214a057..e1d4e74c 100644 --- a/indoteknik_custom/models/stock_move.py +++ b/indoteknik_custom/models/stock_move.py @@ -11,6 +11,15 @@ class StockMove(models.Model): 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) diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml index 20fc709e..fab83885 100644 --- a/indoteknik_custom/views/stock_picking.xml +++ b/indoteknik_custom/views/stock_picking.xml @@ -121,6 +121,7 @@ + @@ -169,11 +170,24 @@ + + + stock.move.line.operations.tree.inherit stock.move.line -- cgit v1.2.3