[FIX] mrp: send correct id via context

On the manufacturing order form view, the 'update' button to change
the production quantity doesn't give the current mo id to the wizard.
That means 'active_id' is used.
The issue is 'active_id' may refer to another object (a bom or
a workcenter for instance).

This commit fills the default_mo_id key in the context before calling the wizard
to ensure the correct production order is used in the wizard default get.

Task : 2043136

closes odoo/odoo#35453

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
William Henrotin
2019-08-06 13:05:55 +00:00
parent c361c3778e
commit cbcdac469d
@@ -99,6 +99,7 @@
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" force_save="1" groups="uom.group_uom" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<button type="action"
name="%(mrp.action_change_production_qty)d"
context="{'default_mo_id': id}"
string="Update" class="oe_link" attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done','cancel')), ('id', '=', False)]}"/>
</div>
<field name="bom_id"