[FIX] stock: picking action_cancel multi
As the function 'action_cancel' is multi, we cannot set the value 'is_locked' to True by using '='. Because it will raise an error if self contains more or less than 1 record. To fix this we call the 'write' method which support all cases
This commit is contained in:
@@ -543,7 +543,7 @@ class Picking(models.Model):
|
||||
@api.multi
|
||||
def action_cancel(self):
|
||||
self.mapped('move_lines')._action_cancel()
|
||||
self.is_locked = True
|
||||
self.write({'is_locked': True})
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user