File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed
stock_picking_return_restricted_qty Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change @@ -40,17 +40,6 @@ def _create_returns(self):
4040class 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
You can’t perform that action at this time.
0 commit comments