Daily updates from Odoo
Thursday, February 29, 2024
5 changes
1 change
Enhancements to existing features
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#1557172 changes
Enhancements to existing features
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
2 changes
Enhancements to existing features
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.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