[FIX] stock_move_manual_lot: action_assing based on stock_move.write_… - #17
Conversation
hbrunn
left a comment
There was a problem hiding this comment.
please still add the changed tests that trigger the bug you fix
| self.assertEqual(picking2.move_line_ids.lot_id, lot1) | ||
|
|
||
| self.assertEqual(self.quant2.reserved_quantity, 1) | ||
| self.assertEqual(picking2.move_line_ids.lot_id, self.lot2) |
There was a problem hiding this comment.
Not sure how self.lot2 relates to lot2, but we now seem to assert that the lot on the first picking is equal to lot2 in line 110, and the lot on the second picking is equal to self.lot2, which makes the tests fail on
2022-01-07 09:33:58,814 204298 ERROR 12stock_move_manual_lot odoo.addons.stock_move_manual_lot.tests.test_stock_move_manual_lot: FAIL: test_02_reassign_reservation (odoo.addons.stock_move_manual_lot.tests.test_stock_move_manual_lot.TestStockMoveManualLot)
2022-01-07 09:33:58,814 204298 ERROR 12stock_move_manual_lot odoo.addons.stock_move_manual_lot.tests.test_stock_move_manual_lot: ` Pickings are rereserved after their lots were fetched on another
2022-01-07 09:33:58,814 204298 ERROR 12stock_move_manual_lot odoo.addons.stock_move_manual_lot.tests.test_stock_move_manual_lot: Traceback (most recent call last):
2022-01-07 09:33:58,814 204298 ERROR 12stock_move_manual_lot odoo.addons.stock_move_manual_lot.tests.test_stock_move_manual_lot: ` File "/home/bruno/buildout/ou120/parts/stock-logistics-workflow/stock_move_manual_lot/tests/test_stock_move_manual_lot.py", line 114, in test_02_reassign_reservation
2022-01-07 09:33:58,814 204298 ERROR 12stock_move_manual_lot odoo.addons.stock_move_manual_lot.tests.test_stock_move_manual_lot: ` self.assertEqual(picking2.move_line_ids.lot_id, self.lot2)
2022-01-07 09:33:58,814 204298 ERROR 12stock_move_manual_lot odoo.addons.stock_move_manual_lot.tests.test_stock_move_manual_lot: ` AssertionError: stock.production.lot(1122,) != stock.production.lot(1123,)
And I think that what Holger means is, the tests won't reproduce the problem unless the write date of the stock moves are backdated somewhere.
8e8d534 to
69a4c6a
Compare
|
@dkubiak789 you don't need to add all these tests. We already have a swap lot tests. The problem is reproduced with this small change: |
|
When I run tests in test_stock_move_manual_lot.py there is an error: |
|
@dkubiak789 use a database that does not have purchase installed. |
|
Thank you @StefanRijnhart |
3b2e7ce to
4e4748a
Compare
* [IMP] stock_move_manual_lot: make test setup more generic * [FIX] stock_move_manual_lot: keep product_qty up to date This prevents overassignment and, in rare cases, reservation errors.
…date