summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_move.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-12-10 10:27:44 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-12-10 10:27:44 +0700
commit9dbae80871e94f439ea1b6c3cf6a13cab9221532 (patch)
tree0a2eb172ca04907287f442f9e4181f5ab11024c3 /indoteknik_custom/models/stock_move.py
parent2123dbaab7b4ff49d90336d34e2be76e8eb07f8e (diff)
barcode product
Diffstat (limited to 'indoteknik_custom/models/stock_move.py')
-rw-r--r--indoteknik_custom/models/stock_move.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py
index ac2e3cc0..8214a057 100644
--- a/indoteknik_custom/models/stock_move.py
+++ b/indoteknik_custom/models/stock_move.py
@@ -7,6 +7,18 @@ 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,
+ )
+
+ 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()