diff options
| -rw-r--r-- | addons/mrp/tests/test_order.py | 1 | ||||
| -rw-r--r-- | addons/mrp/wizard/change_production_qty.py | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/addons/mrp/tests/test_order.py b/addons/mrp/tests/test_order.py index 2ad70c21f4e..d21e246215e 100644 --- a/addons/mrp/tests/test_order.py +++ b/addons/mrp/tests/test_order.py @@ -516,6 +516,7 @@ class TestMrpOrder(TestMrpCommon): update_quantity_wizard.change_prod_qty() self.assertEqual(mo.move_raw_ids.filtered(lambda m: m.product_id == p1).quantity_done, 20, 'Update the produce quantity should not impact already produced quantity.') + self.assertEqual(mo.move_finished_ids.product_uom_qty, 4) mo.button_mark_done() def test_product_produce_6(self): diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py index 56bba899044..f0ab200582a 100644 --- a/addons/mrp/wizard/change_production_qty.py +++ b/addons/mrp/wizard/change_production_qty.py @@ -35,8 +35,8 @@ class ChangeProductionQty(models.TransientModel): modification = {} for move in production.move_finished_ids.filtered(lambda m: m.state not in ('done', 'cancel')): qty = (qty - old_qty) * move.unit_factor - modification[move] = (move.product_uom_qty - qty, move.product_uom_qty) - move[0].write({'product_uom_qty': move.product_uom_qty - qty}) + modification[move] = (move.product_uom_qty + qty, move.product_uom_qty) + move[0].write({'product_uom_qty': move.product_uom_qty + qty}) return modification def change_prod_qty(self): |
