Skipping potential error when move has been deleted

This commit is contained in:
Raúl Martín
2019-01-21 09:36:15 +01:00
committed by Kitti U
parent c7b6e91927
commit ceb1ab63ab

View File

@@ -39,7 +39,7 @@ class StockMoveLine(models.Model):
def _action_done(self):
res = super(StockMoveLine, self)._action_done()
for ml in self.filtered(
lambda m: m.move_id.allocation_ids):
lambda m: m.exists() and m.move_id.allocation_ids):
qty_done = ml.product_uom_id._compute_quantity(
ml.qty_done, ml.product_id.uom_id)