summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_move.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-01-15 15:43:42 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-01-15 15:43:42 +0700
commitbe1ee2092fef86e79932206cc48d5a146107ac32 (patch)
treee54a8c6ffda996f212ab1c2d03b27a32bab8ba89 /indoteknik_custom/models/stock_move.py
parent8b2897d9c72eb67382221d320d488543aea08323 (diff)
parente4ec9406cd0903db59cfed34781da55a2dba4ca3 (diff)
Merge branch 'odoo-production' into iman/switch-account
Diffstat (limited to 'indoteknik_custom/models/stock_move.py')
-rw-r--r--indoteknik_custom/models/stock_move.py21
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()