From 102bad65020cbece6d43c9f8e7ab43a4f8d09024 Mon Sep 17 00:00:00 2001
From: Cuauhtemoc Diaz Minor <cuauhtemoc.diaz@openpyme.mx>
Date: Tue, 2 Oct 2018 18:32:06 -0500
Subject: [PATCH] refactor(account.invoice): se elimina signal de la
 cancelacion de la factura

Closes #25
---
 l10n_mx_facturae/models/account_invoice.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/l10n_mx_facturae/models/account_invoice.py b/l10n_mx_facturae/models/account_invoice.py
index cf453f4193..1899068a21 100644
--- a/l10n_mx_facturae/models/account_invoice.py
+++ b/l10n_mx_facturae/models/account_invoice.py
@@ -297,10 +297,10 @@ class AccountInvoice(models.Model):
                 )
                 cfdi.action_validate()
 
-    @signals.invoice_cancel.connect
-    def action_cancel(self, cr, uid, ids, context=None):
-        context = dict(context or {})
-        for account_invoice in self.browse(cr, uid, ids, context=context):
+    @api.multi
+    def action_cancel(self,):
+        res = super(AccountInvoice, self).action_cancel()
+        for account_invoice in self:
             # Maybe a third test could review state, but since
             # button cancel only is displayed in open state, we decided to not
             # used third test
@@ -309,6 +309,7 @@ class AccountInvoice(models.Model):
                     account_invoice.cfdi_folio_fiscal
             ):
                 account_invoice.cfdi_id.action_cancel()
+        return res
 
     @staticmethod
     def _sanitize(text):
-- 
GitLab