diff options
| author | Arnold Moyaux <arm@odoo.com> | 2019-03-18 15:27:18 +0000 |
|---|---|---|
| committer | Arnold Moyaux <arm@odoo.com> | 2019-03-20 14:22:09 +0000 |
| commit | 277e32d2dcf03a764f0ea49817564fb92a20b2d5 (patch) | |
| tree | 2b62388e65cdfc1df652f9105d8d2d6efd2af67d /addons/sale_mrp | |
| parent | 8a7b6a4f9c2ab2e8d208e735f86b0c9477a2ca64 (diff) | |
[IMP] stock: allow to change picking on returns
The code that generate the return lines is moved inside
an onchange. The purpose is to allow an inherit that will
modify the picking_id of the wizard. It should trigger the
new return lines without a call to default_get.
task_id 1909413
Diffstat (limited to 'addons/sale_mrp')
| -rw-r--r-- | addons/sale_mrp/tests/test_sale_mrp_flow.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/addons/sale_mrp/tests/test_sale_mrp_flow.py b/addons/sale_mrp/tests/test_sale_mrp_flow.py index 5f46e0b969e..d4cae275bd4 100644 --- a/addons/sale_mrp/tests/test_sale_mrp_flow.py +++ b/addons/sale_mrp/tests/test_sale_mrp_flow.py @@ -921,10 +921,10 @@ class TestSaleMrpFlow(common.TransactionCase): self.assertEquals(order_line.qty_delivered, 7.0) # Return all components processed by backorder_3 - StockReturnPicking = self.env['stock.return.picking'] - default_data = StockReturnPicking.with_context(active_ids=backorder_3.ids, active_id=backorder_3.ids[0]).default_get( - ['move_dest_exists', 'original_location_id', 'product_return_moves', 'parent_location_id', 'location_id']) - return_wiz = StockReturnPicking.with_context(active_ids=backorder_3.ids, active_id=backorder_3.ids[0]).create(default_data) + stock_return_picking_form = Form(self.env['stock.return.picking'] + .with_context(active_ids=backorder_3.ids, active_id=backorder_3.ids[0], + active_model='stock.picking')) + return_wiz = stock_return_picking_form.save() for return_move in return_wiz.product_return_moves: return_move.write({ 'quantity': expected_quantities[return_move.product_id], @@ -941,10 +941,10 @@ class TestSaleMrpFlow(common.TransactionCase): # Now quantity delivered should be 3 again self.assertEquals(order_line.qty_delivered, 3) - default_data = StockReturnPicking.with_context(active_ids=return_pick.ids, active_id=return_pick.ids[0]).default_get( - ['move_dest_exists', 'original_location_id', 'product_return_moves', 'parent_location_id', 'location_id']) - return_wiz = StockReturnPicking.with_context(active_ids=return_pick.ids, active_id=return_pick.ids[0]).create( - default_data) + stock_return_picking_form = Form(self.env['stock.return.picking'] + .with_context(active_ids=return_pick.ids, active_id=return_pick.ids[0], + active_model='stock.picking')) + return_wiz = stock_return_picking_form.save() for move in return_wiz.product_return_moves: move.quantity = expected_quantities[move.product_id] res = return_wiz.create_returns() |
