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
closesodoo/odoo#131390
Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
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
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
closesodoo/odoo#129595
Related: odoo/upgrade#4980
Signed-off-by: Laurent Smet (las) <las@odoo.com>
`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`.
closesodoo/odoo#129691
X-original-commit: d5edca101e6a1dd751a3c95d713831e99fc18462
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
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`.
closesodoo/odoo#129166
Signed-off-by: Laurent Smet (las) <las@odoo.com>
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
closesodoo/odoo#125642
Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
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.
closesodoo/odoo#128867
Signed-off-by: Laurent Smet (las) <las@odoo.com>
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
closesodoo/odoo#127092
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
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.
closesodoo/odoo#125438
X-original-commit: dd56297e8b462539c913803eeb23a224fc9e93ac
Signed-off-by: Laurent Smet <las@odoo.com>
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.
closesodoo/odoo#125437
X-original-commit: a70a388cc6cba1f0f440ca7b9dafe9b6ef6593f4
Signed-off-by: Laurent Smet <las@odoo.com>
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'.
closesodoo/odoo#125302
X-original-commit: ec1209c2853ead82bcf27728612d1a7efc6dc97a
Signed-off-by: Laurent Smet <las@odoo.com>
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
closesodoo/odoo#124496
Signed-off-by: Laurent Smet <las@odoo.com>
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
closesodoo/odoo#124436
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
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
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
closesodoo/odoo#122385
X-original-commit: ec895c56c36794f76b5b778833cee655a7c9bfec
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
`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`).
closesodoo/odoo#121522
Related: odoo/enterprise#41124
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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
closesodoo/odoo#119120
Signed-off-by: Laurent Smet <las@odoo.com>