From 0eb60a8b360a41462fcbebc8e0a5cc9239b878d5 Mon Sep 17 00:00:00 2001 From: tdi-odoo Date: Mon, 26 Sep 2016 10:09:05 +0200 Subject: [PATCH] [FIX] account: fix unreconciling invoices, raising a wrong error. That bug was introduced when removing the invoice workflow, where a call to action_invoice_cancel() has been used instead of action_invoice_reopen() which does slightly different things, as you can imagine. --- addons/account/models/account_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 1d72f861a15..23b1a849809 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -353,7 +353,7 @@ class AccountInvoice(models.Model): reconciled = self.filtered(lambda invoice: invoice.reconciled) not_reconciled = self - reconciled (reconciled & pre_reconciled).filtered(lambda invoice: invoice.state == 'open').action_invoice_paid() - (not_reconciled & pre_not_reconciled).filtered(lambda invoice: invoice.state == 'paid').action_invoice_cancel() + (not_reconciled & pre_not_reconciled).filtered(lambda invoice: invoice.state == 'paid').action_invoice_re_open() return res @api.model @@ -578,7 +578,7 @@ class AccountInvoice(models.Model): @api.multi def action_invoice_cancel(self): if self.filtered(lambda inv: inv.state not in ['proforma2', 'draft', 'open']): - raise UserError(_("Invoice must be in draft or Pro-forma state in order to validate it.")) + raise UserError(_("Invoice must be in draft,Pro-forma or open state in order to be cancelled.")) return self.action_cancel() @api.multi