-
- Downloads
[FIX] mrp: rounding issues and efficiency replacement
Before, when you would put a quantity in a BoM line that was not rounded to its UoM (e.g. use 0.3 piece with rounding 1.0) it would not round this quantity in the MO also (when exploding the BoM), and the user could also enter a not rounded quantity himself for the quantity produced or consumed. The moves were split with the exact quantities, but the moves were validated taking into account rounded quantities. This resulted in either moving 2 pieces instead of 1 (entering 0.7 or 1 piece) or raising an error telling you can not process moves with 0 quantity (0.3 piece). As product_efficiency and product_rounding was removed from the BoM/BoM line in v10, if the rounding is correctly handled, the feature could work like in v9, by e.g. putting 1.03 in the bom line (97% efficiency) and rounding up when exploding the BoM (e.g. producing 10 pieces would put it to 11). When "producing", we round the produced qty to the product uom (it does not make sense to produce 1.32 if your uom rounding is 1.0). The user might now change the produced quantity, that's why we round-up when validating the move: indeed, if the user slightly increase the produced value (below the uom unit), it actually means he produced more. This way, instead of not rounding anything and doing rounding behind the scenes, leading to errors, we round everything and the user sees the result directly.
Showing
- addons/mrp/models/mrp_bom.py 5 additions, 0 deletionsaddons/mrp/models/mrp_bom.py
- addons/mrp/models/mrp_workorder.py 3 additions, 2 deletionsaddons/mrp/models/mrp_workorder.py
- addons/mrp/models/stock_move.py 8 additions, 2 deletionsaddons/mrp/models/stock_move.py
- addons/mrp/tests/test_order.py 32 additions, 0 deletionsaddons/mrp/tests/test_order.py
- addons/mrp/wizard/mrp_product_produce.py 7 additions, 4 deletionsaddons/mrp/wizard/mrp_product_produce.py
Loading
Please register or sign in to comment