Skip to content

Commit

Permalink
[FIX] l10n_br_nfe: don't read stacking point id
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Jul 21, 2024
1 parent 37b813b commit c7666fb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions l10n_br_nfe/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,10 @@ def _export_field(self, xsd_field, class_obj, member_spec, export_value=None):
return super()._export_field(xsd_field, class_obj, member_spec, export_value)

def _export_many2one(self, field_name, xsd_required, class_obj=None):
"""
Overriden to avoid creating inner tag for m2o if none of the
denormalized inner attribute has been set.
"""
self.ensure_one()
if field_name in self._stacking_points.keys():
if field_name == "nfe40_ISSQNtot" and not any(
Expand All @@ -668,7 +672,10 @@ def _export_many2one(self, field_name, xsd_required, class_obj=None):
fields = [
f
for f in comodel._fields
if f.startswith(self._field_prefix) and f in self._fields.keys()
if f.startswith(self._field_prefix)
and f in self._fields.keys()
and not f
in self._stacking_points.keys() # don't try to nfe40_fat id when reading nfe40_cobr
]
sub_tag_read = self.read(fields)[0]
if not any(
Expand Down Expand Up @@ -1223,7 +1230,7 @@ def _nfe_send_for_authorization(self):
# Commit to secure receipt info for future queries.
in_testing = getattr(threading.current_thread(), "testing", False)
if not in_testing:
self.env.cr.commit()
self.env.cr.commit() # pylint: disable=invalid-commit

# Check if 'nfe_separate_async_process' is set in the company
# settings. If True, skip the receipt consultation in this
Expand Down

0 comments on commit c7666fb

Please sign in to comment.