Skip to content

Instantly share code, notes, and snippets.

@gabrielbalog
Last active February 12, 2018 18:12
Show Gist options
  • Select an option

  • Save gabrielbalog/76b562e5e1a248e05aa64d0bb29b5b84 to your computer and use it in GitHub Desktop.

Select an option

Save gabrielbalog/76b562e5e1a248e05aa64d0bb29b5b84 to your computer and use it in GitHub Desktop.
def _prepare_edoc_vals(self, inv, inv_lines):
res = super(AccountInvoice, self)._prepare_edoc_vals(inv, inv_lines)
if res.get('nfse_eletronic'):
res['nfse_eletronic'] = inv.nfse_eletronic
res['ambiente_nfse'] = 'homologacao' \
if inv.company_id.tipo_ambiente_nfse == '2' else 'producao'
res['serie'] = inv.service_serie_id.id
res['serie_documento'] = inv.service_serie_id.code
res['model'] = inv.service_document_id.code
res['numero'] = inv.service_serie_id.internal_sequence_id.next_by_id()
return res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment