Skip to content

Commit

Permalink
[FIX] mrp: unlock a raw move line
Browse files Browse the repository at this point in the history
Usecase to reproduce:
- Go on a Mo
- Edit and Unlock
- Produce the MO
- Update a raw move and add a move line

User error you quant write on product_qty fields.
product_qty represent the reserved quantity on move line as quant's UoM.
The system requires to write a product_uom_qty that represent the same
quantity but in the move line UoM.

Fix it by removing the fields from the view, so it's no more save.
Also set the quantity done as readonly if the lines are present in
the view.

closes #32135

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
  • Loading branch information
amoyaux committed Mar 27, 2019
1 parent 799ab73 commit 27e9c9e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions addons/mrp/views/stock_move_views.xml
Expand Up @@ -26,7 +26,7 @@
</div>
<label for="quantity_done" attrs="{'invisible': [('parent.state', '=', 'draft')]}"/>
<div class="o_row" attrs="{'invisible': [('parent.state', '=', 'draft')]}">
<span><field name="quantity_done" attrs="{'readonly': ['|', ('is_locked', '=', True), '|', ('finished_lots_exist', '=', True), ('has_tracking', '!=', 'none')]}" nolabel="1"/></span>
<span><field name="quantity_done" attrs="{'readonly': ['|', '|', ('move_line_ids', '!=', False), ('is_locked', '=', True), '|', ('finished_lots_exist', '=', True), ('has_tracking', '!=', 'none')]}" nolabel="1"/></span>
<span> / </span>
<span><field name="reserved_availability" nolabel="1"/></span>
</div>
Expand Down Expand Up @@ -55,7 +55,6 @@
<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')"/>
<field name="product_uom_qty" string="Reserved" readonly="1"/>
<field name="qty_done"/>
<field name="product_qty" invisible="1"/>
<field name="workorder_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="product_uom_id" invisible="1"/>
Expand Down

0 comments on commit 27e9c9e

Please sign in to comment.