[FIX] purchase: use field in purchase_stock

The field move_dest_ids is now defined in purchase_stock (since the split at
rev 8d4609a1db)

The line was added in purchase at f6b3247c31 in 11.0 but incorrectly forward
ported.

This commit only moves the code to the appropriate module.
This commit is contained in:
Martin Trigaux
2018-08-14 11:16:50 +02:00
parent daec62ab68
commit e08f947abe
2 changed files with 3 additions and 1 deletions
-1
View File
@@ -324,7 +324,6 @@ class PurchaseOrder(models.Model):
for inv in order.invoice_ids:
if inv and inv.state not in ('cancel', 'draft'):
raise UserError(_("Unable to cancel this purchase order. You must first cancel the related vendor bills."))
order.order_line.write({'move_dest_ids':[(5,0,0)]})
self.write({'state': 'cancel'})
+3
View File
@@ -105,6 +105,9 @@ class PurchaseOrder(models.Model):
for pick in order.picking_ids.filtered(lambda r: r.state != 'cancel'):
pick.action_cancel()
order.order_line.write({'move_dest_ids':[(5,0,0)]})
return super(PurchaseOrder, self).button_cancel()
@api.multi