[FIX] mrp: open stat buttons with proper id

On the workcenter form view, the stats button open some analytics but
the wrong worcenter id is given into context. it uses active_id but this
id refers to the first object of the breadcrum and so could be something else
than a workcenter.

closes odoo/odoo#37233

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
William Henrotin
2019-09-23 08:13:34 +00:00
parent b354f017a0
commit 070456169b
+2 -2
View File
@@ -303,13 +303,13 @@
<span class="o_stat_text">Lost</span>
</div>
</button>
<button name="%(action_mrp_workcenter_load_report_graph)d" type="action" class="oe_stat_button" icon="fa-bar-chart" context="{'search_default_workcenter_id': active_id}">
<button name="%(action_mrp_workcenter_load_report_graph)d" type="action" class="oe_stat_button" icon="fa-bar-chart" context="{'search_default_workcenter_id': id}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="workcenter_load" widget="statinfo" nolabel="1"/> Minutes</span>
<span class="o_stat_text">Load</span>
</div>
</button>
<button name="%(mrp_workorder_report)d" type="action" class="oe_stat_button" icon="fa-bar-chart" context="{'search_default_workcenter_id': active_id, 'search_default_thisyear': True}">
<button name="%(mrp_workorder_report)d" type="action" class="oe_stat_button" icon="fa-bar-chart" context="{'search_default_workcenter_id': id, 'search_default_thisyear': True}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="performance" widget="statinfo" nolabel="1"/>%</span>
<span class="o_stat_text">Performance</span>