Daily updates from Odoo
Wednesday, November 20, 2024
15 changes
3 changes
Resolved issues and error corrections
This fixes the customer portal account form so users can see and select available state or province options. It prevents customers from getting stuck when updating address details, improving self-service account management.
Original PR description
Reproduce --- - -i website,portal - open /my/account - select state -> BUG nothing to select from History of changes --- From newest to latest da2c32470c63b8a45ddfb3565c158feece33c924 just reformatted it 14183883432e9d35c6240e1d7dc8c51d04cb93db it also just reformatted it ea27c1b7a341b6f913197a2e8843562c5e71ea52 moved from addons/website_portal/views/website_portal_templates.xml 55d72e1ab4a64f52e040911a8b4b4c8ce9443f65 updated in here c3c0408471763ea90e9379a2d05fd2add820d57e initially introduced it opw-4218359 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
This fixes an installation issue where Odoo could pick an unsuitable chart of accounts when a company had no country set. The change prevents failed module installations and avoids applying accounting settings that do not match the company’s country.
Original PR description
When new modules with coas are being installed, the matching coa based on country is autoinstalled if possible, but if multiple charts match then we overwrite the autoinstall and use the one from the last module. Here we make sure we do not overwrite the chart if it is not associated with the company's country. Using a chart not associated with any country (except generic_coa) during module installation will result in failure. Problem is reproduced on: 1- CI when any syscohada module is installed 2- start a new db and do not set a country on your company, then try installing any syscohada module --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Fixes issues that could prevent the website logout page from displaying correctly, including errors caused by language handling during early page loading. This improves the sign-out experience for website visitors and avoids unexpected error pages.
Original PR description
The website module overrides `ir.http:_get_default_lang`, which is called by `http_routing`'s override of `ir.http:_match`. In this override, it calls `website:_get_cached('default_lang_id')` which…
The website module overrides `ir.http:_get_default_lang`, which is called by `http_routing`'s override of `ir.http:_match`.
In this override, it calls `website:_get_cached('default_lang_id')` which calls `website:_get_cached_values`.
However, `ir.http:_match` is called at a time when the environment hasn't been completely initialized (it will be properly initialized when `ir.http:_authenticate` is called), and its context language hasn't been checked against activated languages yet.
This means that `website:_get_cached_values` cannot rely on this language. The first of the two bugs fixed by this commit happens when website has translatable fields. When reading data from the website, the ORM does a prefetch and tries to load this other field, but fails because the language of the context is invalid. The fix is to prefetch manually the four fields that are not translatable and that we want to cache.
The second bug happens specifically on the logout page, which is set as `auth='none'` by the web module. The website module already overrides the `/web/login` route to set it as `auth='public'` in order to be able to read the website. We need to do the same with the /web/session/logout route, so that the page renders properly.
This commit targets saas-17.2 as the first branch because it is fixing two bugs that were introduced as follows, as determined by a git bisect.
- in a3a3650 from #112000 (saas-17.1), the call to /web/session/logout fails with a 500 status (IndexError) because rule.endpoint.routing has no 'no_db' key, in '_serve_ir_http'.
- in 584a172 from #112000 too (saas-17.1), that code is removed, and the error is now a 403 status because it is not possible to read website records without a user. This error is fixed by adding user='public' to the logout route.
- since d01302b from #151502 (saas-17.2), the test added in this commit could reproduce the error in _get_cached_values by accessing the logout route.
As the saas-17.1 is already EOL, we target saas-17.2 and forward-port it to master.
[OPW-3721341](https://www.odoo.com/odoo/project.task/3721341)
[OPW-3911437](https://www.odoo.com/odoo/project.task/3911437)1 change
Resolved issues and error corrections
Enabling UPS delivery in Inventory settings now installs the current UPS integration instead of the legacy one. This prevents users from being placed on the outdated connector and ensures the expected shipping setup is activated.
Original PR description
Steps to reproduce the bug:
- Go to the inventory settings:
- Enable the UPS delivery
Problem:
The Legacy UPS is installed instead of the new one
opw-43417769 changes
Resolved issues and error corrections
This fix lets website grid sections expand vertically when content needs more room, such as on smaller screens or in longer translated text. It helps prevent cramped or overflowing content, improving the visitor experience across devices and languages.
Original PR description
Website CSS grid bug fix affecting responsiveness to smaller screen resolutions. **Description of the issue/feature this PR addresses:** Having `grid-auto-rows` fixed at 50px stops the grid cells from growing in order to accommodate its content when the content narrows and increases in height. **Current behavior before PR:** Div does not respond to changes in screen resolution or changes caused by the content being translated to a different language. **Desired behavior after PR is merged:** Using the `minmax()` CSS function allows the grid cells to expand vertically to accommodate content that exceeds the minimum height of 50px, improving responsiveness on smaller screens. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix allows website content blocks to grow vertically when text wraps on smaller screens or after translation. It helps prevent cramped or cut-off content, improving the viewing experience across devices and languages.
Original PR description
Website CSS grid bug fix affecting responsiveness to smaller screen resolutions. **Description of the issue/feature this PR addresses:** Having `grid-auto-rows` fixed at 50px stops the grid cells from expanding vertically in order to accommodate it's content when the content narrows and increases in height. **Current behavior before PR:** Div does not respond to changes in screen resolution or changes caused by the content being translated to a different language. **Desired behavior after PR is merged:** Using the `minmax()` CSS function allows the grid cells to expand vertically to accommodate content that exceeds the minimum height of 50px, improving responsiveness on smaller screens. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fixes an issue where empty company-specific numeric or yes/no fields could cause database errors when records were loaded. Businesses using multi-company setups should see more reliable access to records with optional fields left blank.
Original PR description
Issue --> For company dependant fields of type `boolean`, `integer`, `float`, `monetary`, casting a `null` value leads to a `cannot cast jsonb null to type _` error on postgresql. For example,…
Issue -->
For company dependant fields of type `boolean`, `integer`, `float`, `monetary`, casting a `null` value leads to a `cannot cast jsonb null to type _` error on postgresql.
For example, consider the following ->
1. Database has two companies : 'a' and 'b'
2. has one res.partner record with no `credit_limit` set.
3. `credit_limit` (float or numeric) is not a required field and does not have a default value
`credit_limit` on the backend looks like `{"a.id": null, "b.id": null}`
Fetching the value for this field leads to method `_field_to_sql` which builds the select query, while also casting the type to each field. In this case, with no fallback default value and a float field, the query is `SELECT ("res_partner"."credit_limit"->'a.id')::double precision FROM res_partner` which resolves to `null(jsonb)::double precision` which unfortunately, is not supported on Postgresql.
Solution -->
Remove the condition for the types `boolean`, `integer`, `float`, `monetary` and use the `field->company_id->>0` logic instead. This works because the `->>` operator returns a text object; the text `null` value can be cast into the types mentioned above.
https://github.com/odoo/odoo/blob/2ed38db47ac3152eef1a0e328c8ff572474d079f/odoo/models.py#L2964-L2967
opw-4313425
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prPortal users can now view pages containing the Blog snippet without hitting an error. The fix changes how the author name is shown so it no longer depends on permissions that portal users do not have.
Original PR description
Since [1], the template attempted to display the author's name using `record.author_id.name`, which caused access errors for portal users due to insufficient permissions on the res.partner model. By switching to the related field `author_name`, the template no longer requires direct access to `res.partner`, ensuring smooth functionality for all users. Steps to reproduce: - Log in as an administrator - Navigate to Website - Enter Edit Mode - Add a "Blog" snippet to the home page - Save the changes - Log out - Log in as a portal user - Observe that a traceback occurs [1]: https://github.com/odoo/odoo/commit/dbb72d1f68cf7f462e1d6bdf8998f29627ccc2f0 opw-4330845
This fix removes an incorrect blocking warning that prevented credit notes from being sent with UBL XML files when no recipient bank was set. Businesses can now process and send credit notes normally while keeping the bank requirement for customer invoices where it applies.
Original PR description
The previous warning asking to add a Recipient Bank was shown incorrectly in previous versions in case of Credit Notes. With the rework, we escalated this warning to a danger warning that prevent from sending, as in case of Customer Invoices it is a blocking error. The combinations of those two is now preventing Credit Notes to be sent with an UBL XML file. See: https://github.com/odoo/odoo/commit/9e769e1b11f22890e5245859053bc8dd31e42634 task-no
Regular employees can once again open their time off dashboard when their allocation uses an accrual plan. The fix ensures available time off is calculated correctly without exposing unnecessary setup details to users.
Original PR description
Accrual plans are not readable for regular users, so once a user has an accrual plan set on one of his allocation, he cannot open anymore his time off dashboard when it tries to get his allocation data (the time off he has). To ensure the correct computation of available time off, we add a sudo. This has been introduced in https://github.com/odoo/odoo/pull/172892/ --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The product catalog now waits for component changes to finish before refreshing shopfloor records. This prevents newly added manufacturing components from temporarily disappearing when users close the catalog quickly, improving reliability for shopfloor workflows and tests.
Original PR description
### Issue: Since 18.0, the catalog is used in certain actions of the shopfloor However, if you leave the catalog fast enough after your last change (something of the order of ~0.5 sec in localhost),…
### Issue: Since 18.0, the catalog is used in certain actions of the shopfloor However, if you leave the catalog fast enough after your last change (something of the order of ~0.5 sec in localhost), you can trigger a reload of the shopfloor records and call a `web_read` prior to the update of these records. ### Note: This is easily reproducible by hand in localhost and should worsen if you have server delay.In addition, Also, it makes it impossible to write a proper tour involving the catalog in the shopfloor. ### Steps to reproduce: - Create a product with a bom and an operation op1 - Create and confirm an MO for 1 unit of that product - Go to the shopfloor > on the operation > wheel > Add component - Add a component to be consumed in that operation - Close the catalog fast (using ESC for instance) #### > While the componenet was correctly added to the MO and linked to the WO it is not visible on the shopfloor. ### Cause of the issue: When a product is added from the catalog it triggers an rpc call to update the data's of the MO (notably creating a new raw move): https://github.com/odoo/odoo/blob/193c9a49dfc039ee93fbc8e171819236697b5c50/addons/product/static/src/product_catalog/kanban_record.js#L62-L69 https://github.com/odoo/odoo/blob/193c9a49dfc039ee93fbc8e171819236697b5c50/addons/mrp/models/mrp_production.py#L2898-L2901 On the other hand, closing the product catalog will reload the mrp record that started the action that opened the catalog: https://github.com/odoo/enterprise/blob/c1346dd2279bf3882b47b260b8d03ef9651ffaf1/mrp_workorder/static/src/mrp_display/dialog/mrp_menu_dialog.js#L41-L45 Since this reload is currently not waiting for the update of the record the associated `web_read` might be called prior to the last update of the record and the newly created raw moves might not be displayed. ### Fix: We use the props option of the action opening the catalog to transfer a callback to reload the records when all the record update promisses are resolved. Enterprise: https://github.com/odoo/enterprise/pull/72942 opw-4199156 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Changing the project while creating a new timesheet no longer accidentally starts timers or creates duplicate records. The timer now starts only when users intentionally launch it from the timesheet timer header, reducing erroneous timesheet entries.
Original PR description
Steps to reproduce:
- List/grid view
- Click 'New'
- Change project field (1 or more times)
- Switch to kanban view
=> Timer started and many records created
Source of the bug:
- due to this condition 'record.isNew && record.data.project_id', introduced in commit 576c0eac3b8431a5080b6383ae256a0699ba7c7d,
each time project_id field is changed, action_start_new_timesheet_timer is called to start the timer and create a new record.
Fix:
- Start the timer only if new is called from the header timer by checking is_timer_running for that record.
task-4210112This update improves the signing experience by fixing mobile display problems, preventing expired items from appearing in completion dialogs, and ensuring refused signature requests are properly cancelled. It also stabilizes related automated checks so archived or cancelled requests are handled consistently.
Original PR description
Before this commit, some things were unclear. The mobile view was not working as expected and expired sign items were displayed in the thank you dialog. Refusing sign request would not cancel them.…
Before this commit, some things were unclear. The mobile view was not working as expected and expired sign items were displayed in the thank you dialog. Refusing sign request would not cancel them. Moreover this commit fix the sign tests. This commit aims to fix an issue with test_archived_requests_dont_send_reminders. Previously the test was trying to archive a record by performing a direct write command, but since we have a designated action for archiving sign requests, it should be used. Another issue is that when we archive a sign request, its state is set to 'canceled', and for canceled sign requests we cannont update the validity, however the test was trying to update the validity (as a way of jumping to the future). But this is not the correct way of doing it, since we shouldn't change the validity if state is canceled. To fix the issue, a mock_datetime_and_now is introduced. Note: this is the backport of https://github.com/odoo/enterprise/pull/73156 task: 4294860
2 changes
Resolved issues and error corrections
This update fixes a rounding issue in the Mexican CFDI invoice generation process. The change ensures that the subtotal and discount values are calculated accurately, aligning with Mexican tax regulations. This improves the reliability of invoices for Mexican customers.
Original PR description
### Steps to reproduce the issue: 1. Activate Mexican Localization 2. With a Mexican Company, create an Invoice and add a Product with a valid UNSPSC code 3. On the Invoice Line, set Price to 1030.17…
### Steps to reproduce the issue:
1. Activate Mexican Localization
2. With a Mexican Company, create an Invoice and add a Product with a valid UNSPSC code
3. On the Invoice Line, set Price to 1030.17 and add a 3% Discount
4. Confirm then Send & Print (with CFDI checked)
5. In the generated XML, the following values are off:
- In node "Comprobante, SubTotal="1030.16" Descuento="30.90"
- In node "Concepto", ValorUnitario="1030.16" Importe="1030.16" Descuento="30.90"
- Expected are 1030.17 and 30.91
### Explanation:
During the calculation of the values for the CFDI, `gross_price_subtotal_before_discount` is calculated using `price_subtotal` in every case where `discount` is not 100%. This is due to other values affecting `price_subtotal` (e.g.: taxes with `price_include=True`), in which case calculating a value related to `price_subtotal` with `price_unit` would give the wrong result.
This calculation method causes rounding issues such as above because `price_subtotal` is rounded before calculating `gross_price_subtotal_before_discount`.
### Fix reasoning:
We need to account for any value that could affect `price_subtotal` and make it different from `price_unit * quantity` except for `discount`, which will be included when comparing both values.
The case `discount == 100.0` is covered by this new condition as well, since `discount_factor` would equal to 0 and `price_subtotal` too.
opw-4183556This update resolves an issue where new states were incorrectly created for Amazon orders, leading to data inconsistencies and confusion. The change now creates an activity for the sales representative to manually set the correct state, ensuring data accuracy and preventing disruptions to related workflows.
Original PR description
Before this commit contact created from amazon order create new state if it does not find matching state in odoo and it was causing issues like having record multiple record for same state and user don't know which one is right with proper code in data. This commit stop creating new state instead create activity on contact for amazon sale person to set proper state on the related contact to not break flows that are related to contact's state. Backport of b327ea1897fca34164a9bbea59a23d34b97e65a2 task-3865454 Forward-Port-Of: odoo/enterprise#74099