Skip to content

Commit

Permalink
[ADD] Import taxes fields
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcardoso21 committed Jul 2, 2020
1 parent 3e1414f commit 635c6c0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion l10n_br_nfe/models/document_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ def _build_attr(self, node, fields, vals, path, attr, create_m2o,
node, fields, vals, path, attr, create_m2o, defaults)

def _build_string_not_simple_type(self, key, vals, value, node):
if key not in ['nfe40_CST', 'nfe40_modBC', 'nfe40_CSOSN']:
if key not in ['nfe40_CST', 'nfe40_modBC', 'nfe40_CSOSN',
'nfe40_vBC']:
super(NFeLine, self)._build_string_not_simple_type(
key, vals, value, node)
# TODO avoid collision with cls prefix
Expand All @@ -413,6 +414,15 @@ def _build_string_not_simple_type(self, key, vals, value, node):
('tax_domain', '=', 'cofins')])[0].id
elif key == 'nfe40_modBC':
vals['icms_base_type'] = value
elif key == 'nfe40_vBC':
if node.original_tagname_.startswith('ICMS'):
vals['icms_base'] = value
elif node.original_tagname_.startswith('IPI'):
vals['ipi_base'] = value
elif node.original_tagname_.startswith('PIS'):
vals['pis_base'] = value
elif node.original_tagname_.startswith('COFINS'):
vals['cofins_base'] = value

def _build_many2one(self, comodel, vals, new_value, key, create_m2o):
if self._name == 'account.invoice.line' and \
Expand Down

0 comments on commit 635c6c0

Please sign in to comment.