[FIX] stock: quant_package unpack

When you unpack a quant package, you have to invalidate the reservation
on the move lines reserved on this package and then remove the quants
from it. We need to do it as sudo because, no one has rights on quants.
This commit is contained in:
Pierre Masereel
2018-07-04 14:54:57 +02:00
parent 64b67c7f91
commit 63a98846b1
+1 -1
View File
@@ -386,7 +386,7 @@ class QuantPackage(models.Model):
('product_qty', '!=', 0),
])
move_line_to_modify.write({'package_id': False})
package.mapped('quant_ids').write({'package_id': False})
package.mapped('quant_ids').sudo().write({'package_id': False})
def action_view_picking(self):
action = self.env.ref('stock.action_picking_tree_all').read()[0]