Skip to content

Commit 35da769

Browse files
committed
[FIX] mrp_subcontracting: changing UoM causes unreserve issues
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>
1 parent 91ad6a0 commit 35da769

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

addons/mrp_subcontracting/views/stock_move_views.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<field name="qty_done"
2727
decoration-warning="product_uom_qty &lt; qty_done"
2828
decoration-success="product_uom_qty == qty_done"/>
29-
<field name="product_uom_id" groups="uom.group_uom"/>
29+
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"
30+
attrs="{'readonly': ['|', ('product_uom_qty', '!=', 0.0), '&amp;', ('state', '=', 'done'), ('id', '!=', False)]}"/>
3031
</tree>
3132
</field>
3233
</record>

0 commit comments

Comments
 (0)