diff options
| author | Goffin Simon <sig@odoo.com> | 2018-06-27 14:13:26 +0200 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2018-07-02 07:32:15 +0200 |
| commit | 2ab3fa86fe83d507e9e1152ad2a44811af7f55cd (patch) | |
| tree | b6876e401b52120880c09c4d2425efa095bef776 | |
| parent | 5316406ad7c545bad5532ca621a0bdf3eb66ceac (diff) | |
[FIX] mrp: Adding a stock move line when creating a raw material
In stock.move.lots.form view, the field product_uom must be readonly like
the field product_uom_qty.
When creating a raw material, it was not possible to add a stock move line
with a finished product for a product which is not tracked.
The consumed field must be readonly in mrp_production_form_view view to avoid
to send to the server wrong value manually set.
opw:1861321
| -rw-r--r-- | addons/mrp/views/mrp_production_views.xml | 2 | ||||
| -rw-r--r-- | addons/mrp/views/stock_move_views.xml | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/mrp/views/mrp_production_views.xml b/addons/mrp/views/mrp_production_views.xml index cc2d515c4ab..28988b6db90 100644 --- a/addons/mrp/views/mrp_production_views.xml +++ b/addons/mrp/views/mrp_production_views.xml @@ -126,7 +126,7 @@ <field name="state" invisible="1" force_save="1"/> <field name="product_uom_qty" string="To Consume"/> <field name="reserved_availability" attrs="{'invisible': [('is_done', '=', True)]}" string="Reserved"/> - <field name="quantity_done" string="Consumed"/> + <field name="quantity_done" string="Consumed" readonly="1"/> </tree> </field> </page> diff --git a/addons/mrp/views/stock_move_views.xml b/addons/mrp/views/stock_move_views.xml index dee35480569..a005c82c658 100644 --- a/addons/mrp/views/stock_move_views.xml +++ b/addons/mrp/views/stock_move_views.xml @@ -22,7 +22,7 @@ <label for="product_uom_qty"/> <div class="o_row"> <span><field name="product_uom_qty" readonly="1" nolabel="1"/></span> - <span><field name="product_uom" attrs="{'readonly': [('id', '!=', False)]}" nolabel="1"/></span> + <span><field name="product_uom" readonly="1" nolabel="1"/></span> </div> <label for="quantity_done"/> <div class="o_row"> @@ -44,7 +44,7 @@ <field name="finished_lots_exist" invisible="1"/> </group> </group> - <field name="active_move_line_ids" attrs="{'readonly': [('is_locked', '=', True)], 'invisible': [('has_tracking', '=', 'none'), ('finished_lots_exist', '=', False)]}" context="{'default_workorder_id': workorder_id, 'default_product_uom_id': product_uom, 'default_product_id': product_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_production_id': production_id or raw_material_production_id}"> + <field name="active_move_line_ids" attrs="{'readonly': [('is_locked', '=', True)]}" context="{'default_workorder_id': workorder_id, 'default_product_uom_id': product_uom, 'default_product_id': product_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_production_id': production_id or raw_material_production_id}"> <tree editable="bottom" decoration-success="product_qty==qty_done" decoration-danger="(product_qty > 0) and (qty_done>product_qty)"> <field name="lot_id" attrs="{'column_invisible': [('parent.has_tracking', '=', 'none')]}" domain="[('product_id', '=', parent.product_id)]" context="{'default_product_id': parent.product_id}"/> <field name="lot_produced_id" options="{'no_open': True, 'no_create': True}" domain="[('id', 'in', parent.order_finished_lot_ids)]" invisible="not context.get('final_lots')"/> |
