summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2017-10-09 11:51:57 +0200
committerPierre Masereel <pim@odoo.com>2017-10-09 11:51:57 +0200
commitc7ca783e242ba7963fbb847cb53c3b9be9203936 (patch)
treefc1223ae20e2c1ef11c1311315e5422010d4cdb7
parent44f06a66467cb39780fa65d0cefb44704b072e94 (diff)
[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
-rw-r--r--addons/stock/models/stock_picking.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py
index bc543eecc6f..33faf25e3b7 100644
--- a/addons/stock/models/stock_picking.py
+++ b/addons/stock/models/stock_picking.py
@@ -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