From 5d8de48c65d253cf5800bd32b3040f3c4e1b57a4 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Thu, 21 Dec 2017 09:07:51 +0100 Subject: [PATCH] [FIX] account: typo When calling action_invoice_cancel, we want to cancel only the invoices that are NOT yet cancelled --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index cd84001bc3f..3ee91e5e560 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -805,7 +805,7 @@ class AccountInvoice(models.Model): @api.multi def action_invoice_cancel(self): - return self.filtered(lambda inv: inv.state == 'cancel').action_cancel() + return self.filtered(lambda inv: inv.state != 'cancel').action_cancel() @api.multi def _notification_recipients(self, message, groups):