refactor(account.invoice): se manda a llamar la funcion que verifica si se puede cancelar

parent 97bac4a2
......@@ -300,17 +300,17 @@ class AccountInvoice(models.Model):
@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
account_invoice.check_if_can_cancel()
if (
account_invoice.journal_id.sign_sat and
account_invoice.cfdi_folio_fiscal
):
account_invoice.cfdi_id.action_cancel()
return res
super(AccountInvoice, self).action_cancel()
@staticmethod
def _sanitize(text):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment