Skip to content

Commit

Permalink
Merge pull request #125 from Escodoo/12.0-fiscal-events-wizards-fix-x…
Browse files Browse the repository at this point in the history
…Ender

[12.0-fiscal-events-wizards][IMP] l10n_br_nfe: add field nfe40_xEnder
  • Loading branch information
mileo authored May 10, 2021
2 parents adb4aa4 + 137f412 commit b9a2d62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions l10n_br_nfe/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def _compute_dest(self):
nfe40_infCpl = fields.Char(
compute='_compute_nfe40_additional_data',
)

nfe40_transporta = fields.Many2one(
comodel_name='res.partner'
)
Expand Down
8 changes: 8 additions & 0 deletions l10n_br_nfe/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def _prepare_import_dict(self, values, model=None):
nfe40_IE = fields.Char(related='inscr_est')
nfe40_ISUF = fields.Char(related='suframa')
nfe40_email = fields.Char(related='email')
nfe40_xEnder = fields.Char(compute='_compute_nfe40_xEnder')

# nfe.40.infresptec
nfe40_xContato = fields.Char(related='legal_name')
Expand All @@ -75,6 +76,13 @@ def _prepare_import_dict(self, values, model=None):
('nfe40_CPF', 'CPF')],
"CNPJ/CPF do Parceiro")

@api.multi
def _compute_nfe40_xEnder(self):
for rec in self:
rec.nfe40_xEnder = rec.street + ', ' + rec.street_number
if rec.street2:
rec.nfe40_xEnder = rec.nfe40_xEnder + ' - ' + rec.street2

@api.multi
def _compute_nfe40_enderDest(self):
for rec in self:
Expand Down

0 comments on commit b9a2d62

Please sign in to comment.