odoo/odoo#207366
Created by Platform, Xavier Alt (xal)
- label
- odoo-dev:18.0-do-not-send-move-on-peppol-if-company-not-registered-xal
- head
- e75fe218a2580986ef30f4fd72cad5e6c99e48a2
| odoo/odoo | |
|---|---|
| 18.0 | #207366 |
[FIX] account_peppol: don't suggest sending on PEPPOL if company not registered
Use case:
-
Create an database with eCommerce (
website_sale) (and for a country where PEPPOL is supported) -
Enable
Automatic Invoicein General Settings. -
Configure everything for PEPPOL but do not register the company (Partner have their PEPPOL EAS and Endpoint correctly configured)
-
Enable a card payment provider
-
As a customer, buy something from the shop and paid using a card
=> When post-processing the customer payment (payment.transaction) we will automatically generate and send the invoice; and while trying to send the invoice we will crash with:
ValueError: Expected singleton: account_edi_proxy_client.user()
The reason is that we try to send the invoice to both email and
PEPPOL while the company's registration on PEPPOL was not yet be done.
This commit ensure we don't suggest sending by default on PEPPOL
if the company is not allowed to send on PEPPOL.
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr