From d39fc89324810df765cdcdbe2113446ec5cd882d Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Thu, 23 Jan 2020 09:27:48 +0000 Subject: [PATCH] [FIX] mrp_subcontracting: lot_id instead of lot_name in receipt Usecase to reproduce: - Create a subcontracted product tracked without tracked components - Create a receipt for this product - Click on show detail -> Lot_id are display even if the picking type uses create lot. The assign serial feature is not working either. The lot_id instead of lot_name is required in case of tracked components since it will open the produce wizard and the user will create lot there. However in the case of non-tracked components, the wizard will not be used nor lot created. In this case the classic behavior should be used with lot_name closes odoo/odoo#43997 Task: 2180191 X-original-commit: 00fe4186935435f46a0db197c68e6df956fe80db Signed-off-by: Simon Lejeune (sle) --- addons/mrp_subcontracting/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_subcontracting/models/stock_move.py b/addons/mrp_subcontracting/models/stock_move.py index a6d8a61dd91..72f50c9374e 100644 --- a/addons/mrp_subcontracting/models/stock_move.py +++ b/addons/mrp_subcontracting/models/stock_move.py @@ -71,7 +71,7 @@ class StockMove(models.Model): float_compare(self.quantity_done, self.product_uom_qty, precision_rounding=rounding) < 0: return self._action_record_components() action = super(StockMove, self).action_show_details() - if self.is_subcontract: + if self.is_subcontract and self._has_tracked_subcontract_components(): action['views'] = [(self.env.ref('stock.view_stock_move_operations').id, 'form')] action['context'].update({ 'show_lots_m2o': self.has_tracking != 'none',