Daily updates from Odoo
Monday, December 9, 2024
10 changes · saas-17.2
Resolved issues and error corrections
The self-ordering system now correctly determines which product categories are available when the current time is exactly midnight. This prevents rare automated test failures and helps ensure category availability rules behave reliably at all times of day.
Original PR description
The computation of available category was wrong when the current time was exactly midnight. This was causing runbot error on some test that was exactly executed at midnight. runbot error: 104523, 66109, 107831...
Miscellaneous changes
before this commit, when users applied a filter Invoice or Other in the My Invoices portal and then changed the page number, the selected filter was removed, resetting to the default view. This commit resolves the issue by ensuring the filterby parameter is preserved in the pager's url_args, allowing the selected filter to persist across pagination. opw-4367525 Forward-Port-Of: odoo/odoo#188930
Original PR description
before this commit, when users applied a filter Invoice or Other in the My Invoices portal and then changed the page number, the selected filter was removed, resetting to the default view. This commit resolves the issue by ensuring the filterby parameter is preserved in the pager's url_args, allowing the selected filter to persist across pagination. opw-4367525 Forward-Port-Of: odoo/odoo#188930
Current behaviour: --- When setting mail templates in the communication tab of an event, you initially only see event templates, unless you click on "Search more ..." which allows you to set non-event templates. Expected behaviour: --- Only seeing/and being able to set event templates Steps to reproduce: --- 1. Install event_sale 2. Go to Events, pick an event 3. In the communication tab, remove all templates 4. By clicking on "Search more ..." add a sale template 5. Set as Imm
Original PR description
Current behaviour: --- When setting mail templates in the communication tab of an event, you initially only see event templates, unless you click on "Search more ..." which allows you to set…
Current behaviour: --- When setting mail templates in the communication tab of an event, you initially only see event templates, unless you click on "Search more ..." which allows you to set non-event templates. Expected behaviour: --- Only seeing/and being able to set event templates Steps to reproduce: --- 1. Install event_sale 2. Go to Events, pick an event 3. In the communication tab, remove all templates 4. By clicking on "Search more ..." add a sale template 5. Set as Immediately and After each registration 6. Click on the smart button "Attendees" 7. Create a new attendee with an email then save 8. You may need to create multiple attendees 9. Failed to render inline_template template Cause of the issue: --- When selecting a sale template, the render model is `sale.order` So when passing the registration id to get rendered, it tries to read this id on a `sale.order`, causing an error if a `sale.order` with this id doesn't exist. Caused by: https://github.com/odoo/odoo/commit/6abd149259e9caf815fe1804f1322f623f8fcb50 `_name_search` was overriden, but the "Search more ..." option doesn't used `_name_search` but `web_search_read` Fix: --- Overrode `_search` as well opw-4106237 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#180705
Currently, a traceback occurs when the user changes the SMS iap URL and tries to test SMS mailing. To reproduce this issue: 1) Install `mass_mailing_sms` 2) Add 'B' in the SMS `IAP` URL from the `settings/technical/iap` 3) Open any SMS marketing record and click on the `Test` button Error:- ``` ValueError: unsupported format character 'B' (0x42) at index 152 ``` When the user gives the 'B' in the URL string, it is converted to `%B%` in the URL. As it leads to a traceback as `%s
Original PR description
Currently, a traceback occurs when the user changes the SMS iap URL and tries to test SMS mailing. To reproduce this issue: 1) Install `mass_mailing_sms` 2) Add 'B' in the SMS `IAP` URL from the `settings/technical/iap` 3) Open any SMS marketing record and click on the `Test` button Error:- ``` ValueError: unsupported format character 'B' (0x42) at index 152 ``` When the user gives the 'B' in the URL string, it is converted to `%B%` in the URL. As it leads to a traceback as `%s` is used to format two strings. https://github.com/odoo/odoo/blob/a98a8859696f5a69afe2954a3f5493b611ee252b/addons/sms/tools/sms_api.py#L59 This error occurs when using the old-style string formatting (%s) within an f-string. When using f-strings, we don't need to mix them with the % formatting method. We can replace the `%` formatting with the `format` method. sentry-6072287605 Forward-Port-Of: odoo/odoo#187827
Before this commit, the "Become Superuser" item in the debug menu was visible even if the user was not an admin. This was due to an error in the way that item was defined: it used a key "hide" that was not used by the DebugContext. Instead, it should return a falsy value, as the DebugContext uses a simple filter on the items built by their factory function. After this commit, the superuser menu is only visible to admins. Task - 4260306 --- I confirm I have signed the CLA and read t
Original PR description
Before this commit, the "Become Superuser" item in the debug menu was visible even if the user was not an admin. This was due to an error in the way that item was defined: it used a key "hide" that was not used by the DebugContext. Instead, it should return a falsy value, as the DebugContext uses a simple filter on the items built by their factory function. After this commit, the superuser menu is only visible to admins. Task - 4260306 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189277 Forward-Port-Of: odoo/odoo#186584
**Problem**: When invoking a callback after a hotkey press (e.g., `Alt + B`), the following code: https://github.com/odoo/odoo/blob/bafa915f85fb8fc6ca2ae7d194a4593cb2463c2e/addons/web/static/src/core/hotkeys/hotkey_service.js#L286 fails to save the record. **Solution**: Instead of focusing directly on the `el` element, `blur` the `activeElement` to be sure that any changes are saved. **Steps to reproduce**: 1. Open any sale order. 2. Edit the *Terms and Conditions* field. 3. Press `
Original PR description
**Problem**: When invoking a callback after a hotkey press (e.g., `Alt + B`), the following code: https://github.com/odoo/odoo/blob/bafa915f85fb8fc6ca2ae7d194a4593cb2463c2e/addons/web/static/src/core/hotkeys/hotkey_service.js#L286 fails to save the record. **Solution**: Instead of focusing directly on the `el` element, `blur` the `activeElement` to be sure that any changes are saved. **Steps to reproduce**: 1. Open any sale order. 2. Edit the *Terms and Conditions* field. 3. Press `Alt + B` while the input is focused. 4. Observe that the changes are not saved. opw-4219357 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#185960
In a list view, first manually resize a column. Doing so, the table can either overflow (if the column has been extended), or be smaller that the available space. Then, resize the page. Before this commit, the table kept is previous width, i.e. it could not benefit from the potential available space that came from resizing the window. With this commit, we force the whole widths computation to be reset after a window resize. opw~4318312 Description of the issue/feature this PR addresses:
Original PR description
In a list view, first manually resize a column. Doing so, the table can either overflow (if the column has been extended), or be smaller that the available space. Then, resize the page. Before this commit, the table kept is previous width, i.e. it could not benefit from the potential available space that came from resizing the window. With this commit, we force the whole widths computation to be reset after a window resize. opw~4318312 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#189863
In migration and init scripts, when loading the chart of accounts or parts of it, we should always start with the parent companies to avoid creating duplicate chart records.This [file](https://github.com/odoo/odoo/pull/180029/commits/7b6fb92891e58c3d1de1cb9bd9b4c28354ba6f92) was merged last week. comm PR odoo/odoo#182706 ent PR odoo/enterprise#71421 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I co
Original PR description
In migration and init scripts, when loading the chart of accounts or parts of it, we should always start with the parent companies to avoid creating duplicate chart records.This [file](https://github.com/odoo/odoo/pull/180029/commits/7b6fb92891e58c3d1de1cb9bd9b4c28354ba6f92) was merged last week. comm PR odoo/odoo#182706 ent PR odoo/enterprise#71421 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#183731
Steps - create an accrual plan with a level giving 1 hour every month and a carry over with a maximum of 4 hours. Set accrued gain time at the start of the period and carry-over time at start of the year. - create an allocation using this accrual plan, for a time off type in days, set the start date on the first day of next year. - go to Time Off Dashboard - check the balance on the middle of the month of the following year (e.g. 15 january 2026 if the allocation starts on 1 january 2025
Original PR description
Steps - create an accrual plan with a level giving 1 hour every month and a carry over with a maximum of 4 hours. Set accrued gain time at the start of the period and carry-over time at start of the…
Steps - create an accrual plan with a level giving 1 hour every month and a carry over with a maximum of 4 hours. Set accrued gain time at the start of the period and carry-over time at start of the year. - create an allocation using this accrual plan, for a time off type in days, set the start date on the first day of next year. - go to Time Off Dashboard - check the balance on the middle of the month of the following year (e.g. 15 january 2026 if the allocation starts on 1 january 2025). -> ~14 days of time off available: the max postpone amount is not applied, the time gained is in days and not in hours and more than 1 day is gained/month (balance a few days after the start of the allocation should be +1 added_value but is more than that). Causes: - the maximum amount of carry over `postpone_max_days` is applied in days even if the accrual `added_value` is in hours and the UI shows `postpone_max_days` as "Up to X hours". - `get_future_leaves` returns a number of hours if the allocation is in hours, even if the time off type is in days. - the number of hours from the accrual at the beginning of the allocation is too high if the start of the accrual is in the future and gain time added at the start of the period due to cache not being invalidated. https://github.com/odoo/odoo/blob/19c7737fc05539079cde8641bab608c605efacc5/addons/hr_holidays/models/hr_leave_allocation.py#L575-L578 opw-4272315 Forward-Port-Of: odoo/odoo#185699
This commit removes a typo in a UserError raised when the rendering of the template fails. Fixes #186447 Forward-Port-Of: odoo/odoo#189589
Original PR description
This commit removes a typo in a UserError raised when the rendering of the template fails. Fixes #186447 Forward-Port-Of: odoo/odoo#189589