From 9f2bbcbd61266c0b44ab08e0cfa7ad383664df5b Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Wed, 18 Jul 2018 16:13:01 +0200 Subject: [PATCH] [REF] stock: move line: add tracking fields These fields aren't use in the main form views because we prepare the context before opening the move lines wizard, but we need them in the barcode client action because it is using a form view on this model without clean possibility to prepare the context. --- addons/stock/models/stock_move_line.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/models/stock_move_line.py b/addons/stock/models/stock_move_line.py index 4b0dfdd41d7..81ebfdf39ac 100644 --- a/addons/stock/models/stock_move_line.py +++ b/addons/stock/models/stock_move_line.py @@ -45,12 +45,15 @@ class StockMoveLine(models.Model): from_loc = fields.Char(compute='_compute_location_description') to_loc = fields.Char(compute='_compute_location_description') lots_visible = fields.Boolean(compute='_compute_lots_visible') + picking_type_use_create_lots = fields.Boolean(related='picking_id.picking_type_id.use_create_lots', readonly=True) + picking_type_use_existing_lots = fields.Boolean(related='picking_id.picking_type_id.use_existing_lots', readonly=True) state = fields.Selection(related='move_id.state', store=True, related_sudo=False) is_initial_demand_editable = fields.Boolean(related='move_id.is_initial_demand_editable') is_locked = fields.Boolean(related='move_id.is_locked', default=True, readonly=True) consume_line_ids = fields.Many2many('stock.move.line', 'stock_move_line_consume_rel', 'consume_line_id', 'produce_line_id', help="Technical link to see who consumed what. ") produce_line_ids = fields.Many2many('stock.move.line', 'stock_move_line_consume_rel', 'produce_line_id', 'consume_line_id', help="Technical link to see which line was produced with this. ") reference = fields.Char(related='move_id.reference', store=True, related_sudo=False) + tracking = fields.Selection(related='product_id.tracking', readonly=True) picking_type_entire_packs = fields.Boolean(related='picking_id.picking_type_id.show_entire_packs', readonly=True) def _compute_location_description(self):