Skip to content

Commit

Permalink
[16.0][FIX] edi_ubl partners with no city stop the job
Browse files Browse the repository at this point in the history
  • Loading branch information
VoicuStefan2001 committed Jan 20, 2025
1 parent 6585d9d commit 32d65c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion l10n_ro_account_edi_ubl/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"views/cius_template.xml",
],
"license": "AGPL-3",
"version": "16.0.1.85.0",
"version": "16.0.1.85.1",
"author": "Terrabit," "NextERP Romania," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-romania",
"installable": True,
Expand Down
5 changes: 4 additions & 1 deletion l10n_ro_account_edi_ubl/models/account_edi_xml_cius_ro.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ def _export_invoice_constraints(self, invoice, vals):
# Use send city to check if it's a valid sector
# because when they come from ANAF, not all are
# formatted as SECTORX
send_city = partner.city.upper().replace(" ", "")
if partner.city:
send_city = partner.city.upper().replace(" ", "")

Check warning on line 295 in l10n_ro_account_edi_ubl/models/account_edi_xml_cius_ro.py

View check run for this annotation

Codecov / codecov/patch

l10n_ro_account_edi_ubl/models/account_edi_xml_cius_ro.py#L295

Added line #L295 was not covered by tests
else:
send_city = False

Check warning on line 297 in l10n_ro_account_edi_ubl/models/account_edi_xml_cius_ro.py

View check run for this annotation

Codecov / codecov/patch

l10n_ro_account_edi_ubl/models/account_edi_xml_cius_ro.py#L297

Added line #L297 was not covered by tests
if send_city not in SECTOR_RO_CODES:
constraints[f"ciusro_{partner_type}_invalid_city_name"] = _(
"The following partner's city name is invalid: %s. "
Expand Down

0 comments on commit 32d65c4

Please sign in to comment.