Skip to content

Commit daaa6ab

Browse files
committed
[FIX] account_edi_ubl_cii: fix edi options on journal
We only want the edi.format options to appear on the sale journals (out_invoice, out_refund). In addition, the warnings are no longer displayed on top of the invoice. closes odoo#94368 X-original-commit: dca5a28 Signed-off-by: Laurent Smet <[email protected]> Signed-off-by: Julien Van Roy <[email protected]>
1 parent 8a05c25 commit daaa6ab

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

addons/account_edi_ubl_cii/models/account_edi_format.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def _is_compatible_with_journal(self, journal):
9090
self.ensure_one()
9191
if self.code not in FORMAT_CODES:
9292
return super()._is_compatible_with_journal(journal)
93-
return self._is_ubl_cii_available(journal.company_id)
93+
return self._is_ubl_cii_available(journal.company_id) and journal.type == 'sale'
9494

9595
def _is_enabled_by_default_on_journal(self, journal):
9696
# EXTENDS account_edi
@@ -110,6 +110,7 @@ def _post_invoice_edi(self, invoices, test_mode=False):
110110
res = {}
111111
for invoice in invoices:
112112
builder = self._get_xml_builder(invoice.company_id)
113+
# For now, the errors are not displayed anywhere, don't want to annoy the user
113114
xml_content, errors = builder._export_invoice(invoice)
114115

115116
# DEBUG: send directly to the test platform (the one used by ecosio)
@@ -130,14 +131,6 @@ def _post_invoice_edi(self, invoices, test_mode=False):
130131
'success': True,
131132
'attachment': attachment,
132133
}
133-
if errors:
134-
res[invoice].update({
135-
'success': False,
136-
'error': _("Errors occured while creating the EDI document (format: %s). The receiver "
137-
"might refuse it.", builder._description)
138-
+ '<p> <li>' + "</li> <li>".join(errors) + '</li> </p>',
139-
'blocking_level': 'info',
140-
})
141134

142135
return res
143136

0 commit comments

Comments
 (0)