[FIX] stock, mrp: fix the manufacturing product moves filter

Steps to reproduce the bug:
- Create a storable product > add a BOM
- Create a MO> add the product > confirm > Mark as done
- Go to the product form > click on product moves
- The move linked to the MO is displayed
- Add the "Manufacturing" filter
- No move is displayed

Solution:
Display all "stock.move.line" which are linked to a "stock.move" with a "mrp.production"

Bug2:
The "Manufacturing" filter should be defined in the MRP module instead of the stock
otherwise, users who do not have MRP installed will have access to this filter as well

opw-2697254

closes odoo/odoo#80578

X-original-commit: f4ab29a19f0aaac567da27d4c4d5c79119982bc6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
This commit is contained in:
Touati Djamel (otd)
2021-11-30 12:06:18 +00:00
parent 7d10f4b9a4
commit e2b965cd89
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -40,6 +40,18 @@
</field>
</record>
<record id="stock_move_line_view_search" model="ir.ui.view">
<field name="name">stock.move.line.search</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.stock_move_line_view_search" />
<field name="arch" type="xml">
<filter name="manufacturing" position="attributes">
<attribute name="invisible">0</attribute>
<attribute name="domain">[('move_id.production_id', '!=', False)]</attribute>
</filter>
</field>
</record>
<menuitem id="menu_mrp_traceability"
name="Lots/Serial Numbers"
parent="menu_mrp_bom"
+1 -1
View File
@@ -106,7 +106,7 @@
<filter string="Incoming" name="incoming" domain="[('picking_id.picking_type_id.code', '=', 'incoming')]"/>
<filter string="Outgoing" name="outgoing" domain="[('picking_id.picking_type_id.code', '=', 'outgoing')]"/>
<filter string="Internal" name="internal" domain="[('picking_id.picking_type_id.code', '=', 'internal')]"/>
<filter string="Manufacturing" name="manufacturing" domain="[('picking_id.picking_type_id.code', '=', 'mrp_operation')]"/>
<filter string="Manufacturing" name="manufacturing" domain="[('picking_id.picking_type_id.code', '=', 'mrp_operation')]" invisible="1"/>
<separator/>
<filter name="date" date="date" default_period="this_month"/>
<filter string="Last 30 Days" name="filter_last_30_days" domain="[('date','&gt;=', (context_today() - relativedelta(days=30)).strftime('%Y-%m-%d'))]"/>