summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_move.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-12-31 09:44:11 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-12-31 09:44:11 +0700
commit8d00df73e76162d624d2f32eefdd47ca68ca154c (patch)
treeef2b9706de3bbe895709502bf60506bca8f20a91 /indoteknik_custom/models/stock_move.py
parent6a7b2e28c9c1612ac3e91ac321b72e3400fdb5a3 (diff)
parentd35c2dce88a87bc05d30c4935d51d7d58aa5d37d (diff)
Merge branch 'production' into iman/telegram
# Conflicts: # indoteknik_custom/models/stock_picking.py
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()