Skip to content

Commit

Permalink
[FIX] mrp_subcontracting: changing UoM causes unreserve issues
Browse files Browse the repository at this point in the history
Before this commit:
It was possible to purchase a subcontracted product and on the receipt of the product, change the unit of measure o on the stock move lines of the components when the quantities were already reserved.
This caused unreserve issue given that, all of a sudden, instead of having 200g, we would have 200kg reserved and the change would not be reflected on the quant.

After this commit:
The view was modified to not allow changes of UoM if there are reserved quantities, or if the state is done.

OPW-3742720

closes odoo#154327

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
  • Loading branch information
pno-odoo committed Feb 16, 2024
1 parent 91ad6a0 commit 35da769
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addons/mrp_subcontracting/views/stock_move_views.xml
Expand Up @@ -26,7 +26,8 @@
<field name="qty_done"
decoration-warning="product_uom_qty &lt; qty_done"
decoration-success="product_uom_qty == qty_done"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"
attrs="{'readonly': ['|', ('product_uom_qty', '!=', 0.0), '&amp;', ('state', '=', 'done'), ('id', '!=', False)]}"/>
</tree>
</field>
</record>
Expand Down

0 comments on commit 35da769

Please sign in to comment.