From 855a56ba2962ea5e8a5a52c5552de0551157ae85 Mon Sep 17 00:00:00 2001
From: Josse Colpaert <jco@odoo.com>
Date: Mon, 9 Oct 2017 11:54:00 +0200
Subject: [PATCH] [FIX] mrp: lots of component should always be visible in move
 view of MO

When you open a move of a component in a manufacturing order, we cannot
see the move lines and so add a new on if there are no move lines in it
with finished lot. We now always display the list of move lines if
product is tracked by lot/serial or has finished lots.
---
 addons/mrp/views/stock_move_views.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/mrp/views/stock_move_views.xml b/addons/mrp/views/stock_move_views.xml
index 879f576f3f9e..f1007b8d26b3 100644
--- a/addons/mrp/views/stock_move_views.xml
+++ b/addons/mrp/views/stock_move_views.xml
@@ -44,7 +44,7 @@
                             <field name="finished_lots_exist" invisible="1"/>
                         </group>
                     </group>
-                    <field name="active_move_line_ids" attrs="{'readonly': [('is_locked', '=', True)], 'invisible': [('finished_lots_exist', '=', False)]}" context="{'default_workorder_id': workorder_id, 'default_product_uom_id': product_uom, 'default_product_id': product_id,  'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_production_id': production_id or raw_material_production_id}">
+                    <field name="active_move_line_ids" attrs="{'readonly': [('is_locked', '=', True)], 'invisible': [('has_tracking', '=', 'none'), ('finished_lots_exist', '=', False)]}" context="{'default_workorder_id': workorder_id, 'default_product_uom_id': product_uom, 'default_product_id': product_id,  'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_production_id': production_id or raw_material_production_id}">
                         <tree editable="bottom" decoration-success="product_qty==qty_done" decoration-danger="(product_qty &gt; 0) and (qty_done&gt;product_qty)">
                             <field name="lot_id" attrs="{'column_invisible': [('parent.has_tracking', '=', 'none')]}" domain="[('product_id', '=', parent.product_id)]" context="{'default_product_id': parent.product_id}"/>
                             <field name="lot_produced_id" options="{'no_open': True, 'no_create': True}" domain="[('id', 'in', parent.order_finished_lot_ids)]" invisible="not context.get('final_lots')"/>
-- 
GitLab