Commit Graph
11 Commits
Author SHA1 Message Date
aliya d3fda38f00 [IMP] account_peppol: improve participant onboarding
This commit adds several improvements in Peppol onboarding process:
- Adds a phone number verification process
- Adds a possibility to migrate away/cancel the registration
- Adds a possibility to update contact details for the participant
- UX improvements like autosave
- Set 0208 as the default EAS code for Belgium
- Add a check for certain peppol endpoint numbers (based on Peppol schematron rules)

task-3060814

closes odoo/odoo#127092

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-07-13 19:28:04 +02:00
aliya 874e1e7f24 [FIX] account: add another hook for calling webservice
Currently, we call the web service before the PDF is rendered. This is often required for some localizations, for example Mexico.
However, in some other cases, we need to embed the pdf document in the xml file, like in Peppol. In this case, we need to call the proxy after the pdf has been rendered.

This commit adds an additional hook that is being called in the end of `_generate_invoice_documents`, after all the documents have been generated and postprocessed. `account_peppol` will use the new hook instead of the old one.

closes odoo/odoo#125438

X-original-commit: dd56297e8b462539c913803eeb23a224fc9e93ac
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-16 23:01:20 +02:00
aliya 13960a6725 [FIX] account_peppol: fix several bugs
This commit fixes small bugs:

- Sometimes we don't receive the attachments' file name from the proxy. Instead of saving the attachment with `False` as the filename, we should default to something.
- If for some reason the participant's status is changed on the proxy server after documents have been sent, retrieving the message status will traceback. This commit adds a condition to catch this case.
- Currently, the participant status is only updated if their application is pending. But it can happen that they are approved but not registered to the SMP. Participant status should be checked for approved edi users too.

closes odoo/odoo#125437

X-original-commit: a70a388cc6cba1f0f440ca7b9dafe9b6ef6593f4
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-16 23:01:17 +02:00
Laurent Smet 6af55b6afb [FIX] account_peppol: commit after updating the move
When using the Send & Print wizard in invoice_single, the error is raised if any
making all changes rollbacked including the update of the 'peppol_move_state'.

closes odoo/odoo#125302

X-original-commit: ec1209c2853ead82bcf27728612d1a7efc6dc97a
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-16 01:40:25 +02:00
aliya f4d7d75835 [FIX] account_peppol: fix account_peppol checkbox
Currently:
Create an invoice and send it using Peppol and make sure the PDF and the XML are well generated but Peppol failed for some reason.
When opening the wizard later, the checkbox is no longer there since the XML is already generated.

Fix:
This commit adds enable_peppol to show the checkbox depending on this field, so that if there is already a ubl XML generated, we can still send an invoice via Peppol.
Also, if the ubl generation is enabled but ubl checkbox is not checked, and the user chooses to send via peppol,
we assume that the ubl xml needs to be generated as well.

task-3358419

closes odoo/odoo#124496

Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-15 17:36:30 +02:00
aliya 64a0f84640 [IMP] account_peppol: add tests
account_peppol module currently doesn't have any tests.
This commit adds tests to test the participant,
sending and receiving peppol messages, peppol functionality in the
send and print wizard.

task-3321786

closes odoo/odoo#124436

Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-09 17:01:18 +02:00
Laurent Smet 688897cf10 [FIX] account*: Always send an invoice report using send & print
In case of error, the send & print wizard is crashing or log an error on the invoice chatter.
In that case, nothing is sent to the end-customer.
This is problematic for all flows in which we want to send a mail to the customer automatically.
For example, e-commerce with automatic invoicing or subscription/recurring invoices.

To avoid that, the current logic of the send & print has been reshaped. In case of error, a proforma
PDF is sent instead. This is exactly the same document as the PDF but without the legal layer.

To do that, a lot of refactoring has been necessary to always provide the cumulated data for invoices
to be able to access the generated proforma report and to allow the overrides to know exactly in which
mode the hooks are called.

Also, this commit renames the method by something less generic about invoices. Indeed, this wizard needs to be
usable for others documents than invoices. That's the purpose of the invoice_single/invoice_multi mode.
For that reason, all methods about invoices are now expricitely prefixed by 'invoice'.

Fix also a performance issue on multi-invoices since the invoice_pdf_report_id document was invalided for the
whole model instead of the current record. When dealing with X invoices, the whole model was invalidated X times.

Fix the managment of attachments:
- The manual attachments wasn't send when sending a mail 'invoice_single' mode.
- When changing to another mail template, the manual attachments were lost.

Fix the double generation of PDF using a web-service.
When opening again the send & print wizard, the PDF must not be regenerated but reloaded from the previous one.

Task: 3339352
X-original-commit: e9e90811aeee46989a83b21f9b59071a9c7bc362
Part-of: odoo/odoo#124436
2023-06-09 17:01:17 +02:00
aliya 0872475ab5 [FIX] account_peppol: add proxy urls
This commit adds proxy urls for prod and test peppol servers that are missing at the moment.
Additional small fixes:
- `default_peppol_move_state` when receiving a new document should match the state on the iap server
- not committing when running tests

closes odoo/odoo#122385

X-original-commit: ec895c56c36794f76b5b778833cee655a7c9bfec
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-05-25 16:29:42 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Xavier Morel faabf62a39 [FIX] account_peppol: incorrect view extension
`account_peppol` hooks its addition of `option_peppol` in the invoice
sending form to `option_send_by_post`.

However `option_send_by_post` is added by `snailmail_account` which
`account_peppol` does *not* depend on. And while it's likely
`snailmail_account` has long been installed when `account_peppol` gets
installed there's no actual guarantee, and `snailmail` could even have
been uninstalled.

Which is exactly the issue, when uninstalling `snailmail_account` or
any of its dependencies which don't uninstall `account_peppol`
(`snailmail`, `iap_mail`, `iap`) the "send & print" (send invoice)
wizard is broken.

Fix by re-hooking the view extension on `option_send_mail` instead,
that is installed by an actual dependency of `account_peppol`, and
part of the view which `account_peppol` actually extends
(`account.account_move_send_form`).

closes odoo/odoo#121522

Related: odoo/enterprise#41124
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-05-16 15:55:38 +02:00
aliya be00ef8e37 [ADD] account_peppol: send and receive invoice via peppol
This commits adds `account_peppol` module that allows:
- Registering as an account edi user and send an application to the peppol proxy,
  where the participant can be approved or rejected after reviewing the documents attached.
- Sending invoices by selecting 'Send via Peppol' option in the send & print wizard.
- Receiving peppol documents.

task-3159912

closes odoo/odoo#119120

Signed-off-by: Laurent Smet <las@odoo.com>
2023-05-11 18:25:03 +02:00