[FIX] purchase: use field in purchase_stock
The field move_dest_ids is now defined in purchase_stock (since the split at rev8d4609a1db) The line was added in purchase atf6b3247c31in 11.0 but incorrectly forward ported. This commit only moves the code to the appropriate module.
This commit is contained in:
@@ -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'})
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user