diff options
| author | William Henrotin <whe@odoo.com> | 2020-09-08 10:11:36 +0000 |
|---|---|---|
| committer | William Henrotin <whe@odoo.com> | 2020-10-07 13:58:30 +0000 |
| commit | 5d5220ec3187a0813b8b06e6138200e3f7c3d808 (patch) | |
| tree | 694a6917085ddb158a88c1f2ad64486f1799d731 /addons/mrp/tests/test_order.py | |
| parent | 9c2d02f6e78a01eca02de90dd9406effa0308d27 (diff) | |
[FIX] mrp: no finished move management
This commit makes sure we do not try to update the quantity on a
finished stock move (during record production or confirming the produce
wizard) if there is no finished move available.
Closes #57227
closes odoo/odoo#59423
X-original-commit: 141df3b398aee2bac10e3ce94e15bb4bd14d17af
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Diffstat (limited to 'addons/mrp/tests/test_order.py')
| -rw-r--r-- | addons/mrp/tests/test_order.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/addons/mrp/tests/test_order.py b/addons/mrp/tests/test_order.py index a7e024f146e..90f2945d6e6 100644 --- a/addons/mrp/tests/test_order.py +++ b/addons/mrp/tests/test_order.py @@ -1118,6 +1118,20 @@ class TestMrpOrder(TestMrpCommon): details_operation_form.save() mo2.button_mark_done() + def test_product_produce_12(self): + """ Checks that, the production is robust against deletion of finished move.""" + + self.stock_location = self.env.ref('stock.stock_location_stock') + mo, bom, p_final, p1, p2 = self.generate_mo(qty_final=1) + self.assertEqual(len(mo), 1, 'MO should have been created') + + mo_form = Form(mo) + mo_form.qty_producing = 1 + mo = mo_form.save() + # remove the finished move from the available to be updated + mo.move_finished_ids._action_done() + mo.button_mark_done() + def test_product_produce_uom(self): """ Produce a finished product tracked by serial number. Set another UoM on the bom. The produce wizard should keep the UoM of the product (unit) |
