Skip to content
Snippets Groups Projects
Commit a2f5fc97 authored by Adrien Widart's avatar Adrien Widart
Browse files

[FIX] mrp: create MO from a mobile


It is currently impossible to create a MO from a mobile if there are
some work orders

To reproduce the issue:
1. In Settings, enable "Work Orders"
2. Create two products P_finished, P_compo
3. Create a BoM:
    - Product: P_finished
    - Components:
        - 1 x P_compo
    - Operations:
        - Create a new one
4. Switch to mobile mode
5. Create a MO with P_finished

Error: When saving the MO, a Validation Error is raised "The operation
cannot be completed: - Create/update: a mandatory field is not set.
[...] Model: Work Order (mrp.workorder), Field: Unit of Measure
(product_uom_id)"

For a work order to be created, the request needs to provide two
additional fields: `product_uom_id` and `consumption`. When setting the
product P_finished, an onchange is triggered and does not return
`consumption`. `product_uom_id` is returned but not included in the save
request (because the field is declared as `readonly`)

OPW-2557181

closes odoo/odoo#76228

Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
parent e8e48766
No related branches found
No related tags found
No related merge requests found
......@@ -350,7 +350,8 @@
<field name="workcenter_id"/>
<field name="product_id"/>
<field name="qty_production"/>
<field name="product_uom_id"/>
<field name="product_uom_id" force_save="1"/>
<field name="consumption"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment