Commit Graph
19 Commits
Author SHA1 Message Date
Pierre Pulinckx (pipu) c07181b20b [REF] *: Replace env._t() by _t()
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :

<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>

task-3292454

closes odoo/odoo#131390

Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-18 19:17:16 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
aliya 2d051168a4 [FIX] account_peppol: fix migration key, sql constraints
Currently, the migration key is stored through a workaround as a config parameter,
because the behaviour needed to be changed in stable.
Now, several things can be fixed:
- `account_peppol_migration_key` is now a field on `res.company`, not `account_edi_proxy_client.user`
- `account_peppol_attachment_ids` can be removed as the specs changed and it's no longer necessary
- `peppol_proxy_state` can be removed as it's no longer useful after `enable_peppol` was added
- SQL constraints need to be changed to only include active users.
  This allows users to deregister/migrate away from Peppol and then re-register later, with their previous edi user being archived

closes odoo/odoo#129595

Related: odoo/upgrade#4980
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-03 08:26:28 +02:00
aliya 35d8048044 [FIX] account_peppol: fix saving of the migration key
`account_peppol_migration_key` is a related field, stored on the `account_edi_proxy_client.user`.
We want to allow users to provide a migration key when they want to register as a new peppol participant,
migrating their existing peppol registration from another smp.
However, before they save and validate their registration,
there is no `account_edi_proxy_client.user` associated with the company and
hence the `migration_key` is never saved and never sent to the IAP server.
The solution in master will be to move this field to `res.company`
but in stable the workaround is to store it in `ir.config_parameter` and make it a computed field,
where the config parameter is updated in the inverse method on `account_peppol_migration_key`.

closes odoo/odoo#129691

X-original-commit: d5edca101e6a1dd751a3c95d713831e99fc18462
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-07-26 10:48:54 +02:00
aliya 34eb59f509 [FIX] account_peppol: fix handling of migrated users
Currently, when a user requests a migration key, we set them as 'canceled' and show the migration key.
That means, they won't receive new invoices/invoice status updates.
However, the idea of the migration is that a user should be reachable at all times
and we should receive documents for them up until they are fully migrated to another service.
The solution is to keep `account_peppol_proxy_state` as `active` when they request a migration and display the migration key.
On the IAP side we will check with a cron whether they have migrated or not.
A migrated user is then archived on the IAP side.
That means that whenever we run a cron on the client side, the edi user would not be found,
so the edi user will be archived in `_make_request`.
We can then safely change the `account_peppol_proxy_state` to `not_registered`.

closes odoo/odoo#129166

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-07-20 17:01:53 +02:00
william-andre 0479b2b594 [IMP] account,*: manage subsidiary companies
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models

These records can be read and used in children companies.

This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
  country

task-3371677

closes odoo/odoo#125642

Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-20 11:49:06 +02:00
aliya 88eaa7362a [FIX] account_peppol: add option to deregister
Currently, users cannot deregister from Peppol.
There is an option to migrate away (i.e. request a migration key) but not every provider supports migration.
It is not straightforward to deregister from Peppol once a participant is marked as "prepared for migration",
so the users really should deregister instead.

Also, it is important to run the cron one last time for the user to fetch new documents/message status updates
they've received since the last time the cron ran.

closes odoo/odoo#128867

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-07-19 11:40:06 +02:00
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