Daily updates from Odoo
Thursday, February 29, 2024
10 changes
3 changes
Enhancements to existing features
This update enhances how Odoo generates PDF reports by creating attachments more efficiently. Previously, attachment values needed to be manually overridden for some reports. This change introduces a new process to prepare these attachment values during PDF generation, ensuring consistent and accurate attachment creation without altering the core report functionality.
Original PR description
Description of the issue/feature this PR addresses: Previously, an `ir_actions_report` refactor landed on: - [ ] https://github.com/odoo/odoo/pull/85150 It totally makes sense to create `ir.attachment` from the streams if needed during PDF generation. For some of the projects we still need to override attachment values. This PR provides a hook to prepare attachment values needed for attachments creation during the pdf report generation. Nothing changes in the sense of business logic. Ping @smetl @xmo-odoo --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#153086 Forward-Port-Of: odoo/odoo#138159
This update makes it easier for developers to customize how clicks are handled within the Odoo dropdown menu. Previously, changes required extensive modifications, but now a simpler approach allows for quicker and more efficient updates. This improves the overall flexibility and maintainability of the Odoo web interface.
Original PR description
With this commit, overriding the `onWindowClick` function from `dropdown.js` becomes much simpler. Previously, it necessitated overriding the entire function, but now it can be done with minimal effort by just overriding this specific part. task-3717014 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#155326 Forward-Port-Of: odoo/odoo#154315
This update enhances the testing of Odoo's email functionality, specifically focusing on how event attendee emails are sent in batches. The changes include new tests for batch email sending, improved test setup for event scheduling, and added checks for registration emails. These improvements ensure more reliable email delivery and scalability.
Original PR description
PURPOSE Mail: add tests for MailTemplate send_mail Several flows use MailTemplate.send_mail() in batch, notably event email scheduler which sends emails to event attendee in batch. This commit adds…
PURPOSE
Mail: add tests for MailTemplate send_mail
Several flows use MailTemplate.send_mail() in batch, notably event email
scheduler which sends emails to event attendee in batch. This commit adds
tests around 'send_mail' method of MailTemplate model
* add tests for batch: it is currently not supported hence using a loop but
batch is going to be added soon, allowing to test the batch version works
as intended;
* add query counters, notably for batch mode and when dynamic reports are
involved in templates;
Event: improve mail scheduler tests
Make them easier to improve and modify
* use a dedicated setup (allowing to add specific unit tests on test data);
* move initial asserts into its own unit test (to keep other tests shorter);
* use available mocks for freezetime and sql.now;
Then add tests for registration emails, to check what happens for communication
scheduled right at registration time.
LINKS
Part of Task-3764894: Event: Allow using cron triggers for communication
Part of Task-3764891: Mail: Batch-ize MailTemplate send_mail
Part of Task-3164278: Mail: Batch send: ensure limit, avoid force
Part of Task-3084943: Event: Improve communication scheduler scalability
Forward-Port-Of: odoo/odoo#1557173 changes
Enhancements to existing features
This update simplifies how activity information is handled in form chatter areas across many Odoo apps. It removes unnecessary activity identifiers from screen definitions and prepares view data to carry extra model information when needed, helping keep the interface infrastructure cleaner and easier to maintain.
Original PR description
**Before this PR:**
- Each model in models from `get_views` return data, only contains a dict of fields. The structure of models is like:
```py
models: {
resModel1: {contains resModel1 fields},
resModel2: {contains resModel2 fields},
...
}
```
**After this PR:**
- Adding `fields` in form of `key: value` to each model in `get_views`, makes it possible to add extra data about model beside `fields` if it's needed.
```py
models: {
resModel1: {
fields: {contains resModel1 fields},
extra_data: ...
},
resModel2: {
fields: {contains resModel2 fields}
extra_data: ...
},
...
}
```
- All the `activity_ids` (descendants of `oe_chatter`) are removed from the view arch
[Related Odoo PR](https://github.com/odoo/odoo/pull/154710)Recruitment reports now open the related applicant record directly instead of showing a generic report form. This makes it easier for recruiters to review candidate details and move through the report with fields arranged more logically.
Original PR description
This commit add a form view to replace the auto-generated one. The purpose is to have a better UX for the user to make them able to go to the applicant and order the fields in a way that make more sense to them to enhance the navigation experience. task-3613046
Salary attachments can now only be created for employees who belong to the companies currently selected in the multi-company view. This helps prevent payroll records from being created for the wrong company context and keeps payroll work focused on the relevant companies.
Original PR description
Prevent the creation of salary attachments for employees working in companies not selected in the multi-company widget. This enhancement ensures that salary attachments are relevant and specific to the currently focused companies. Task-3693473
4 changes
Enhancements to existing features
This update adds missing French translations for tax rounding terms in the French localization reports module. The translation files have been reorganized to prevent translations from being marked as obsolete during future updates, making the system more maintainable and ensuring consistent French terminology for tax reporting features.
Original PR description
### [I18N] l10n_fr_reports: add tax rounding terms A few of translations relating to 03ce6ce were not included with the original commit. This commit adds the terms to the l10n_fr_reports.pot file, and the translations to the fr.po file. Thank you Antoine (andu) for the Frenchification of the terms. task-id: 3717388 ### [I18N] l10n_fr_reports: restructure po/pot files Add the missing terms to the pot file. When the terms are missing from the pot file, but present in the po file, they get marked as "obsolete". This happens during the merge function that is called within tools/translate.py. In order to avoid this, the pot and po files have been re-generated and restructured in order to make future additions easier to merge. Forward-Port-Of: odoo/enterprise#56590
This update adds last modification dates to forum post URLs in website sitemaps, helping search engines like Google prioritize crawling more recent content. By providing accurate update information, the change helps search engines use their crawling resources more efficiently and improves the visibility of active forum discussions.
Original PR description
When a crawler (eg Googlebot) come to visit your website, it grants you a limited amount of time and ressources, it's called "Crawler budget". If you have millions of URLs, it won't go through each…
When a crawler (eg Googlebot) come to visit your website, it grants you a limited amount of time and ressources, it's called "Crawler budget". If you have millions of URLs, it won't go through each one of them in a single go.
The best you can help those crawler, the better. The sitemap `lastmod` attribute, despite not being fully respected and trusted by crawlers, is one of the way you can still try to help them.
For website.pages, it's already done. But for controllers, it's not an easy thing to do as we have no way to automatically figure what are the relevant records/fields to look at to know the last update date. For instance, on the event pages, some pages content are mostly stored inside an `ir.ui.view`, but the title, hours etc are part of the event itself.
We can't just say "we take the last write_date of the record", it's wrong in 2 ways:
- The first one I just explained where we wouldn't be able to easily get all the elements part of the page rendering and would miss a possible element write_date, leaving an outdated date in `lastmod`.
- Then, there is another issue (which is more problematic in stable): the `write_date` is often updated for non website related purposes. For instance, on /partners/<partner>, we wouldn't be able to use the write date on odoo.com as the partners shown there (having a grade) are update every weeks in average, because of many fields, for instance: commission_plan_id, partner_weight, grade_id, ...
Still, there is a quick win possible in stable about forum posts which are not impacted by the 2 issues explained above:
- There is a dedicated `last_activity_date` field which is updated only when relevant information are modified. We can ensure to show a date which is not updated too frequently for no reason.
- All the forum.post information displayed on the page are stored inside the forum.post itself.
This commit is thus adding the `lastmod` on forum.post URLs in the sitemap in hope of not making Google waste time on (very) old posts.
Note: the `lastmod` has to be trustworthy and correct, if you set wrong
or outdated info inside it, Google won't trust you/it anymore.This update improves how the system creates attachments when generating PDF reports. A new technical hook has been added that allows customization of attachment details during report generation, making the system more flexible for projects with specific attachment requirements. No changes to how reports work from a user perspective.
Original PR description
Description of the issue/feature this PR addresses: Previously, an `ir_actions_report` refactor landed on: - [ ] https://github.com/odoo/odoo/pull/85150 It totally makes sense to create `ir.attachment` from the streams if needed during PDF generation. For some of the projects we still need to override attachment values. This PR provides a hook to prepare attachment values needed for attachments creation during the pdf report generation. Nothing changes in the sense of business logic. Ping @smetl @xmo-odoo --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#153086 Forward-Port-Of: odoo/odoo#138159
The analytic widget's save button has been redesigned to reduce user confusion. The confusing floppy disk icon that appeared when creating analytic accounts has been replaced with a clearer "New model" link. Additionally, the widget now automatically populates related fields like partner and product information when available, making the workflow more intuitive.
Original PR description
On the analytic widget, when putting an Analytic Account, a floppy disk appear on top of the wizard. This button is used to create a new analytic distribution template. It is confusing for users that thinks that the purpose of the button is to save the analytic distribution. This PR will replace the button to be a link called "New model". Also, this pr will fill some field (partner_id, account_prefix and product_id) if there are populated. task: 3736786 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#153588