diff --git a/addons/account_edi_ubl_cii/models/account_edi_format.py b/addons/account_edi_ubl_cii/models/account_edi_format.py index 353e266c452..0bbf5c89d85 100644 --- a/addons/account_edi_ubl_cii/models/account_edi_format.py +++ b/addons/account_edi_ubl_cii/models/account_edi_format.py @@ -88,7 +88,7 @@ class AccountEdiFormat(models.Model): self.ensure_one() if self.code not in FORMAT_CODES: return super()._is_compatible_with_journal(journal) - return self._is_ubl_cii_available(journal.company_id) + return self._is_ubl_cii_available(journal.company_id) and journal.type == 'sale' def _is_enabled_by_default_on_journal(self, journal): # EXTENDS account_edi @@ -108,6 +108,7 @@ class AccountEdiFormat(models.Model): res = {} for invoice in invoices: builder = self._get_xml_builder(invoice.company_id) + # For now, the errors are not displayed anywhere, don't want to annoy the user xml_content, errors = builder._export_invoice(invoice) # DEBUG: send directly to the test platform (the one used by ecosio) @@ -128,14 +129,6 @@ class AccountEdiFormat(models.Model): 'success': True, 'attachment': attachment, } - if errors: - res[invoice].update({ - 'success': False, - 'error': _("Errors occured while creating the EDI document (format: %s). The receiver " - "might refuse it.", builder._description) - + '

  • ' + "
  • ".join(errors) + '
  • ', - 'blocking_level': 'info', - }) return res