Commit d3d2764a authored by agb80's avatar agb80

style(flake): actualiza los estilos para cumplir con flake

parent bb8d90d0
Pipeline #5836 passed with stage
in 1 minute and 8 seconds
......@@ -12,4 +12,5 @@
<field name="active" eval="False" />
</record>
</data>
</openerp>
\ No newline at end of file
</openerp>
......@@ -11,17 +11,17 @@ _logger = logging.getLogger(__name__)
def compute_cfdi_id(env):
ir_attachment_mx_obj = env["ir.attachment.facturae.mx"]
invoices = env["account.invoice"].search([("state", "in", ["open", "paid"])])
_logger.info("invoices to set cfdi_id: " + str(len(invoices)))
"""Update reference to `ir.attachment.facturae.mx` for invoices"""
ir_attachment_mx_obj = env['ir.attachment.facturae.mx']
invoices = env['account.invoice'].search([('state', 'in', ['open', 'paid'])])
_logger.info('Updating reference for cfdi on ' + str(len(invoices)) + ' invoices')
for invoice in invoices:
related_attachment = ir_attachment_mx_obj.search(
[
("res_id", "=", invoice.id),
("type_attachment", "=", "account.invoice"),
("company_id", "=", invoice.company_id.id),
("state", "in", ["signed", "done"]),
('res_id', '=', invoice.id),
('type_attachment', '=', 'account.invoice'),
('company_id', '=', invoice.company_id.id),
('state', 'in', ['signed', 'done']),
]
)
if related_attachment:
......
......@@ -199,7 +199,7 @@ class AccountInvoice(models.Model):
@api.model
def cron_invoices_pending_to_cancel(self):
invoices =self.env['account.invoice'].search(
invoices = self.env['account.invoice'].search(
[
('state', 'in', ['waiting'])
]
......@@ -294,9 +294,9 @@ class AccountInvoice(models.Model):
):
cancelacion = account_invoice.cancel_cfdi()[0]
if cancelacion is None:
account_invoice.write({
'state': account_invoice.cfdi_state,
})
account_invoice.write(
{'state': account_invoice.cfdi_state}
)
elif cancelacion is False:
self.undo_waiting_state()
else:
......@@ -306,16 +306,15 @@ class AccountInvoice(models.Model):
@api.multi
def undo_waiting_state(self):
'''when cancel is negate, undo waiting state'''
"""when cancel is negate, undo waiting state"""
self.ensure_one()
if self.state in ("waiting"):
if self.state == 'waiting':
self.write({
"state":"open"
'state': 'open'
})
@api.multi
def action_consult_cancellation_status(self):
""" """
for account_invoice in self:
res = None
status_cancelacion = account_invoice.consult_cfdi_cancellation_status()
......
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