Monday, January 20, 2025
23 changes · saas-17.2
Resolved issues and error corrections
Odoo Studio now only offers fields that can safely be used for sorting in list views. This prevents users from saving a sort option that would later trigger an error when opening or loading the list.
Original PR description
## Description - when applying sort by for a non-stored field in a list view, it leads to traceback. - when fetching data, when attempting to convert it into an SQL query, now throws error after this…
## Description
- when applying sort by for a non-stored field in a list view, it leads to traceback.
- when fetching data, when attempting to convert it into an SQL query, now throws error after this [commit](https://github.com/odoo/odoo/commit/fb0569eeba0a8909a067f2ad90b80edbe8d2d915), form this [line](https://github.com/odoo/odoo/blame/de47ec932742ef82b315990cbac8787f82aa91d5/odoo/models.py#L2846)
- This pr ensures that only stored fields are available for sorting in the list view editor, preventing such issues.
## steps to reproduce
- Start a db ( version 17.2 or greater)
- install studio and contacts app
- open studio editor for contact app's list view.
- Add display_name in list and set `sort by` attribute with `display_name` field.
## Traceback
```py
File "/home/odoo/odoo/codebase/odoo/saas-17.2/addons/web/controllers/dataset.py", line 34, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/odoo/odoo/codebase/odoo/saas-17.2/odoo/api.py", line 458, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "/home/odoo/odoo/codebase/odoo/saas-17.2/addons/web/models/models.py", line 46, in web_search_read
records = self.search_fetch(domain, specification.keys(), offset=offset, limit=limit, order=order)
File "/home/odoo/odoo/codebase/odoo/saas-17.2/odoo/models.py", line 1626, in search_fetch
query = self._search(domain, offset=offset, limit=limit, order=order or self._order)
File "/home/odoo/odoo/codebase/odoo/saas-17.2/odoo/models.py", line 5454, in _search
query.order = self._order_to_sql(order, query)
File "/home/odoo/odoo/codebase/odoo/saas-17.2/odoo/models.py", line 5266, in _order_to_sql
term = self._order_field_to_sql(alias, field_name, sql_direction, sql_nulls, query)
File "/home/odoo/odoo/codebase/odoo/saas-17.2/odoo/models.py", line 5324, in _order_field_to_sql
sql_field = self._field_to_sql(alias, field_name, query)
File "/home/odoo/odoo/codebase/odoo/saas-17.2/odoo/models.py", line 2846, in _field_to_sql
raise ValueError(f"Cannot convert field {field} to SQL")
ValueError: Cannot convert field res.partner.display_name to SQL
```This fix removes a value that was never actually provided by the external service, which meant documents could show an empty or meaningless field. The change prevents confusing information from appearing in Peppol-related document/account flows.
Original PR description
The value sent from IAP was never sent. So what was printed was always None. So we remove its uses (and will change the method definition in non-stable
The Lebanon accounting demo company setup now correctly recognizes demo data during installation. This avoids an unnecessary warning and helps demo environments install more smoothly.
Original PR description
The install_demo is missing from the try_loading of the Libanese demo company. runbot-109449 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
**Issue:** In 17.0 and saas-17.2, The Cost of Scrap section does not appear in the the Cost Analysis Report despite having scrapped some components during manufacturing. **Steps to reproduce:** 1. Create a product with a BoM 2. Manufacture the product 3. Scrap some components during manufacturing 4. print the Cost Analysis Report 5. Notice the cost of scrap section does not appear in the report. **Solution:** - I added `raw_material_production_id` t
Original PR description
**Issue:**
In 17.0 and saas-17.2, The Cost of Scrap section does not appear
in the the Cost Analysis Report despite having scrapped some components
during manufacturing.
**Steps to reproduce:**
1. Create a product with a BoM
2. Manufacture the product
3. Scrap some components during manufacturing
4. print the Cost Analysis Report
5. Notice the cost of scrap section does not appear in the report.
**Solution:**
- I added `raw_material_production_id` to the search criteria to ensure scrap stock moves linked to raw materials are also included.
- I replaced `product_qty` with the `quantity` field for handling scrap quantities.
opw-4183097
Forward-Port-Of: odoo/enterprise#75221Steps to reproduce ================== - Install hr_timesheet - Use an android device - Click on a time field => A numeric virtual keyboard appears. This prevents us from entering the `:` character. Cause of the issue ================== The inputmode attribute is set to numeric Solution ======== Set the inputmode to it's default value: text. See also [float_time_field] --- [float_time_field]: https://github.com/odoo/odoo/commit/8b919ae51d7deb34169b7c6970964056ef2e
Original PR description
Steps to reproduce ================== - Install hr_timesheet - Use an android device - Click on a time field => A numeric virtual keyboard appears. This prevents us from entering the `:` character. Cause of the issue ================== The inputmode attribute is set to numeric Solution ======== Set the inputmode to it's default value: text. See also [float_time_field] --- [float_time_field]: https://github.com/odoo/odoo/commit/8b919ae51d7deb34169b7c6970964056ef2eb632 opw-4344083 Forward-Port-Of: odoo/enterprise#77339
Before this commit, created moves were not done in batch making the amount of queries go up uselessly. This commit makes that creation in batch and adapts the query counters in tests. task-4299915 Forward-Port-Of: odoo/enterprise#73145
Original PR description
Before this commit, created moves were not done in batch making the amount of queries go up uselessly. This commit makes that creation in batch and adapts the query counters in tests. task-4299915 Forward-Port-Of: odoo/enterprise#73145
Without this change it's impossible to remove the user groups from internal users, because they're being re-added upon the module updates. The reason is because there's a mechanism in place that synchronizes the newly added groups to the default user, so they're automatically added to all internal users ([ref](https://github.com/odoo/odoo/blob/6b5a839428b06e09d90631e9824a9b594ff8f4f5/odoo/addons/base/models/res_users.py#L621-L626)). For this reason and by convention, groups added t
Original PR description
Without this change it's impossible to remove the user groups from internal users, because they're being re-added upon the module updates.
The reason is because there's a mechanism in place that synchronizes the newly added groups to the default user, so they're automatically added to all internal users ([ref](https://github.com/odoo/odoo/blob/6b5a839428b06e09d90631e9824a9b594ff8f4f5/odoo/addons/base/models/res_users.py#L621-L626)).
For this reason and by convention, groups added to the default user should be non-updateable, so system administrators can remove them if they wanted to.
Related to: https://github.com/odoo/enterprise/commit/621824fb3fe1b5b895d1a37a15d45e903bc7dc6f
--
ping @tde-banana-odoo @tivisse
Forward-Port-Of: odoo/enterprise#75177
Forward-Port-Of: odoo/enterprise#55024This PR fixes two accessibility issues related to the gantt view connectors. Prior to this commit, the connectors were using the raw value when hovering the pill. This is mostly fine is light mode, but for some specific color, this was sometimes not enough to ensure a good visual separation between the connectors and the pill. To handle this issue, we add a pseudo element underneath the border, to make it stand out and prevent all the potential contrast issues. There was also a `z-index` is
Original PR description
This PR fixes two accessibility issues related to the gantt view connectors. Prior to this commit, the connectors were using the raw value when hovering the pill. This is mostly fine is light mode, but for some specific color, this was sometimes not enough to ensure a good visual separation between the connectors and the pill. To handle this issue, we add a pseudo element underneath the border, to make it stand out and prevent all the potential contrast issues. There was also a `z-index` issues with the connectors, the one at the bottom being hidden by the pill below. To fix the issue, we handle the `z-index` at the pill wrapper level to ensure it gets the right elevation. | 17.0 | This PR | |--------|--------| | <img width="366" alt="image" src="https://github.com/user-attachments/assets/f14d3c98-c2d5-4215-90ec-3cbe97b3ea56"> |  | task-3865935 Forward-Port-Of: odoo/enterprise#74859
The tool tip is being replaced with a more concise message. task-4437887 Forward-Port-Of: odoo/enterprise#76474
Original PR description
The tool tip is being replaced with a more concise message. task-4437887 Forward-Port-Of: odoo/enterprise#76474
Steps: - Install the hr_holiday module - Configure Time Off Type with validation set to `Approved by Time Off Officer` or `Both` - Create a Time Off request without setting a Time Off Officer. --- Description of the issue/feature this PR addresses: When the validation type is set to `hr` or `both` and no Time Off Officer is configured, an activity is incorrectly generated upon creating a Time Off request. --- Fix: This PR requires adding responsible_ids in the test cases. The ch
Original PR description
Steps: - Install the hr_holiday module - Configure Time Off Type with validation set to `Approved by Time Off Officer` or `Both` - Create a Time Off request without setting a Time Off Officer. --- Description of the issue/feature this PR addresses: When the validation type is set to `hr` or `both` and no Time Off Officer is configured, an activity is incorrectly generated upon creating a Time Off request. --- Fix: This PR requires adding responsible_ids in the test cases. The changes made in this task remove activities when responsible_ids is not set, causing the test cases to fail. Adding responsible_ids will ensure the tests pass successfully. task-4351688 Forward-Port-Of: odoo/enterprise#75828
In this PR: - Refactored error handling for better clarity and organization. - Grouped errors by section and invoice for structured reporting. - Added clickable invoice links in error messages for easy navigation. - Scheduled detailed activities for invoices with errors. - Enhanced code readability and maintainability. This ensures clearer error reports, efficient activity creation, and easier future updates. Forward-Port-Of: odoo/enterprise#76880
Original PR description
In this PR: - Refactored error handling for better clarity and organization. - Grouped errors by section and invoice for structured reporting. - Added clickable invoice links in error messages for easy navigation. - Scheduled detailed activities for invoices with errors. - Enhanced code readability and maintainability. This ensures clearer error reports, efficient activity creation, and easier future updates. Forward-Port-Of: odoo/enterprise#76880
**Steps to reproduce:** - Configure `Analytic Accounting` via `Accounting` module's settings; - Go to `Analytic Plans` through `Accounting / Configuration / Analytic Accounting`: - Select any record and change its name for a really long one;  - Go to `Expenses` app: - Select any expense in the list; - Open the `Analytic Distribution` widget. ___ **
Original PR description
**Steps to reproduce:** - Configure `Analytic Accounting` via `Accounting` module's settings; - Go to `Analytic Plans` through `Accounting / Configuration / Analytic Accounting`: - Select any record…
**Steps to reproduce:**
- Configure `Analytic Accounting` via `Accounting` module's settings;
- Go to `Analytic Plans` through `Accounting / Configuration / Analytic Accounting`:
- Select any record and change its name for a really long one;

- Go to `Expenses` app:
- Select any expense in the list;
- Open the `Analytic Distribution` widget.
___
**Issue:**
Long `Analytic Plans` names are wrapped and may lead to unreadable texts.

*(from the ticket - Odoo 17)*

___
**Expected:**
A smooth UI should display `Analytic Plans` as when accessed through an invoice line from `Accounting` app.

___
**Cause:**
The `Analytic Distribution` widget style of the invoice view inherits from the list renderer, forcing a `nowrap` style while the expense view of the same widget does not.
___
**Fix:**
Force a `nowrap` style for that specific widget.

___
opw-4357324
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#192203**Problem**: When `lot['lot_record'].product_id.valid_ean` is `False`, the `final_barcode` variable retains the value from the previous iteration. This leads to incorrect concatenation with the current `lot['name']` when `lot['lot_record'].product_id.tracking == 'lot'`. **Solution**: Reset the `final_barcode` variable at the start of each iteration. **Steps to Reproduce**: 1. Go to Inventory > Settings and enable "Print GS1 Barcodes for Lots & Serial Numbers". 2. Navigate to Inventory
Original PR description
**Problem**: When `lot['lot_record'].product_id.valid_ean` is `False`, the `final_barcode` variable retains the value from the previous iteration. This leads to incorrect concatenation with the current `lot['name']` when `lot['lot_record'].product_id.tracking == 'lot'`. **Solution**: Reset the `final_barcode` variable at the start of each iteration. **Steps to Reproduce**: 1. Go to Inventory > Settings and enable "Print GS1 Barcodes for Lots & Serial Numbers". 2. Navigate to Inventory > Products > Lots/Serial Numbers. 3. Select all records and click Print > Lot/Serial Number (ZPL). 4. Observe that some barcodes incorrectly include the previous barcode as a prefix. opw-4437745 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193519 Forward-Port-Of: odoo/odoo#192651
**Problem**: Enabling the addition of videos from Studio is not supported. This option should be removed. **Steps to Reproduce**: 1. In Studio, focus on any HTML field. 2. Under "Properties," there should be no "videos" option. opw-4405801 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#191183
Original PR description
**Problem**: Enabling the addition of videos from Studio is not supported. This option should be removed. **Steps to Reproduce**: 1. In Studio, focus on any HTML field. 2. Under "Properties," there should be no "videos" option. opw-4405801 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#191183
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#193752
Original PR description
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#193752
Steps: - Install the hr_holiday module - Configure Time Off Type with validation set to `Approved by Time Off Officer` or `Both` - Create a Time Off request without setting a Time Off Officer. --- Description of the issue/feature this PR addresses: When the validation type is set to `hr` or `both` and no Time Off Officer is configured, an activity is incorrectly generated upon creating a Time Off request. --- Fix: This PR resolves the issue by ensuring the responsible user is s
Original PR description
Steps: - Install the hr_holiday module - Configure Time Off Type with validation set to `Approved by Time Off Officer` or `Both` - Create a Time Off request without setting a Time Off Officer. --- Description of the issue/feature this PR addresses: When the validation type is set to `hr` or `both` and no Time Off Officer is configured, an activity is incorrectly generated upon creating a Time Off request. --- Fix: This PR resolves the issue by ensuring the responsible user is set to empty when validation is `hr` or `Both` and no Time Off Officer is configured. task-4351688 Forward-Port-Of: odoo/odoo#190193
`accounting_supplier_party` was never sent right from IAP, it was always 'None'. So, we could never log it. But the information was in fact always useless. This information is already in the UBL file. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#192740
Original PR description
`accounting_supplier_party` was never sent right from IAP, it was always 'None'. So, we could never log it. But the information was in fact always useless. This information is already in the UBL file. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#192740
'TestQwebFieldContact' used a demo partner to work, but we want to test independent of demo data. Forward-Port-Of: odoo/odoo#193716
Original PR description
'TestQwebFieldContact' used a demo partner to work, but we want to test independent of demo data. Forward-Port-Of: odoo/odoo#193716
Backporting from saas-17.3 odoo/odoo#137572 because of tickets, see opws below. The OpenSSL call started not working after `cryptography==42.0.8` \--- Some of the invoices (i.e. those from Servizio Elettrico Nazionale, the ex-monopoly-of-energy company) have custom signatures that rely on an old OpenSSL implementation that breaks the current one that sees them as malformed, so we cannot read those files. Also, we couldn't find an alternative way to use OpenSSL to just get the same res
Original PR description
Backporting from saas-17.3 odoo/odoo#137572 because of tickets, see opws below. The OpenSSL call started not working after `cryptography==42.0.8` \--- Some of the invoices (i.e. those from Servizio…
Backporting from saas-17.3 odoo/odoo#137572 because of tickets, see opws below. The OpenSSL call started not working after `cryptography==42.0.8` \--- Some of the invoices (i.e. those from Servizio Elettrico Nazionale, the ex-monopoly-of-energy company) have custom signatures that rely on an old OpenSSL implementation that breaks the current one that sees them as malformed, so we cannot read those files. Also, we couldn't find an alternative way to use OpenSSL to just get the same result without getting the error. A new fallback method has been added that reads the ASN1 file structure and takes the encoded pkcs7-data tag content out of it, regardless of the signature. Being a non-optimized pure Python implementation, it takes about 2x the time than the regular method, so it's better used as a fallback. We didn't use an existing library not to further pollute the dependencies space. \--- opw-4471459 opw-4437288 opw-4417875 Forward-Port-Of: odoo/odoo#194211 Forward-Port-Of: odoo/odoo#193950
This PR addresses the layout issue in the sidebar of the portal, where a preview of the customer's invoice is displayed. Before this PR, users encountered a broken layout for large invoice amounts, making it difficult to read the total. This issue is resolved in this PR by adding a rules for the `h2` and `span` fields ensuring proper wrapping for better readability. Steps to reproduce: - Login as admin. - Go to Website app. - Navigate to "My account" at my/home url. - Click on "
Original PR description
This PR addresses the layout issue in the sidebar of the portal, where a preview of the customer's invoice is displayed. Before this PR, users encountered a broken layout for large invoice amounts, making it difficult to read the total. This issue is resolved in this PR by adding a rules for the `h2` and `span` fields ensuring proper wrapping for better readability. Steps to reproduce: - Login as admin. - Go to Website app. - Navigate to "My account" at my/home url. - Click on "My invoices" or navigate to my/invoices url. - Click on one invoice in order to see its preview. - Via the browser tools, edit the amount of on the left sidebar and insert a very big number. task-4435472 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#192769
@qrtl ------------------------------- I confirm I have signed the CLA and read the PR guidelines at [www.odoo.com/submit-pr](http://www.odoo.com/submit-pr) Forward-Port-Of: odoo/odoo#194087
Original PR description
@qrtl ------------------------------- I confirm I have signed the CLA and read the PR guidelines at [www.odoo.com/submit-pr](http://www.odoo.com/submit-pr) Forward-Port-Of: odoo/odoo#194087
### Steps to reproduce: - In Accounting create a new tax like this: -Tax computation: percentage of price tax included -Amount: 100% -Included in Price: Ticked - Create a new Customer Invoice in another currency - Use the 100% tax - Go in the tab "Journal Entries" - The amounts were not converted ### Cause: The rate is calculated like this : `rate = line.amount_currency / line.balance if line.balance else 1` But with this specific tax `amount_currency` and `balance` are 0 so the rate de
Original PR description
### Steps to reproduce: - In Accounting create a new tax like this: -Tax computation: percentage of price tax included -Amount: 100% -Included in Price: Ticked - Create a new Customer Invoice in another currency - Use the 100% tax - Go in the tab "Journal Entries" - The amounts were not converted ### Cause: The rate is calculated like this : `rate = line.amount_currency / line.balance if line.balance else 1` But with this specific tax `amount_currency` and `balance` are 0 so the rate defaults to 1 thus not converting. ### Solution: Fallback on the rate of the line. opw-4443522 Forward-Port-Of: odoo/odoo#193593
Before this commit, the module_loader was showing error by empty the DOM and then adding his element with the errors. The issue is, if you have an error because of custom script or after an upgrade, then you were lockout because the DOM with empty and you cannot go fix the script. After this commit, a shorter message will be shown in the bottom-left of the screen. This message will invite the user to check the devtool to have more details about the error. --- I confirm I have signed the
Original PR description
Before this commit, the module_loader was showing error by empty the DOM and then adding his element with the errors. The issue is, if you have an error because of custom script or after an upgrade, then you were lockout because the DOM with empty and you cannot go fix the script. After this commit, a shorter message will be shown in the bottom-left of the screen. This message will invite the user to check the devtool to have more details about the error. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193912