[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 one
additional field: `product_uom_id`. When setting the
product P_finished, `product_uom_id` is returned but not included
in the save request (because the field is declared as `readonly`)

OPW-2557181

closes odoo/odoo#76572

X-original-commit: 57c5e06f4f6de60ebc8b933ed327613588256273
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
This commit is contained in:
Adrien Widart
2021-09-15 15:22:05 +00:00
parent 22faf86089
commit 4385307f4e
+1 -1
View File
@@ -381,7 +381,7 @@
<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"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">