Skip to content

Commit 8398544

Browse files
committed
[16.0][FIX] stock_picking_return_restricted_qty: remove _onchange_quantity method
1 parent 69d27dd commit 8398544

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

stock_picking_return_restricted_qty/tests/test_stock_picking_return_restricted_qty.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_multiple_return(self):
102102

103103
wiz.product_return_moves.quantity = 80
104104
with self.assertRaises(UserError):
105-
wiz.product_return_moves._onchange_quantity()
105+
wiz._create_returns()
106106

107107
def test_multiple_return_without_restriction(self):
108108
"""On this test we are going to follow a sequence that a client
@@ -122,5 +122,5 @@ def test_multiple_return_without_restriction(self):
122122
self.assertEqual(wiz.product_return_moves.quantity, 10)
123123

124124
wiz.product_return_moves.quantity = 80
125-
wiz.product_return_moves._onchange_quantity()
125+
wiz._create_returns()
126126
self.assertEqual(wiz.product_return_moves.quantity, 80)

stock_picking_return_restricted_qty/wizard/stock_picking_return.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ def _create_returns(self):
4040
class ReturnPickingLine(models.TransientModel):
4141
_inherit = "stock.return.picking.line"
4242

43-
@api.onchange("quantity")
44-
def _onchange_quantity(self):
45-
restrict_return_qty = (
46-
self.move_id.picking_id.picking_type_id.restrict_return_qty
47-
)
48-
49-
qty = self.get_returned_restricted_quantity(self.move_id)
50-
51-
if restrict_return_qty and self.quantity > qty:
52-
raise UserError(_("Return more quantities than delivered is not allowed."))
53-
5443
def get_returned_restricted_quantity(self, stock_move):
5544
"""This function is created to know how many products
5645
have the person who tries to create a return picking

0 commit comments

Comments
 (0)