[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:
Pierre Masereel
2017-10-09 11:51:57 +02:00
parent 44f06a6646
commit c7ca783e24
+1 -1
View File
@@ -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