Skip to content
Snippets Groups Projects
Commit c7ca783e authored by Pierre Masereel's avatar Pierre Masereel
Browse files

[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
parent 44f06a66
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment