Wednesday, July 3, 2024
37 changes · saas-17.1
Resolved issues and error corrections
This fixes an automated test for Belgian salary contract signatures that could fail depending on the time of day it ran. The test now uses a consistent daytime setting, making validation more reliable without changing user-facing behavior.
This fixes an error that could occur in Studio when users tried to open a newly created listing page from the website menu. The “View in Website” option now appears only where it is relevant and opens correctly, reducing disruption while configuring website content.
Original PR description
Steps to reproduce ================== - Install website_studio - Open any app - Open studio - Click on the website tab - Create a new listing type and confirm - Click on the three dots - View in…
Steps to reproduce ================== - Install website_studio - Open any app - Open studio - Click on the website tab - Create a new listing type and confirm - Click on the three dots - View in website => TypeError: Cannot read properties of undefined (reading 'action') Cause of the issue ================== Before https://github.com/odoo/enterprise/pull/49809/commits/7980155915f25128e7cb8d5a0af91ffe45bb44c7 ```xml <t t-set="onItemClicked" t-value="page.page_type === 'listing' ? this.openPageUrl.bind(this, page) : this.onConfigurePage.bind(this, page)" /> <t t-set="openPageUrl" t-value="page.page_type === 'listing' ? onItemClicked : null" /> <DropdownItem t-if="openPageUrl" onSelected="openPageUrl" href="'#'">View in website</DropdownItem> ``` in the new version, `t-if="openPageUrl"` was always true because `openPageUrl` refers to the function and not the template variable. The function was also not bound to `this`. Solution ======== - The "View in Website" button should only be displayed for pages of listing type. - We add the this to the function call opw-3987521
Miscellaneous changes
This commit odoo/odoo@af46b928a18da8e6276c107c5ed07cfd9e87d1bf introduced a fix to ensure submenu pages uniqueness. An issue arises when manual submenu are created and don't have a view_id set. To avoid this issue, we now fallback on the initial page receives if no view is found. Forward-Port-Of: odoo/odoo#171556 Forward-Port-Of: odoo/odoo#171391
Original PR description
This commit odoo/odoo@af46b928a18da8e6276c107c5ed07cfd9e87d1bf introduced a fix to ensure submenu pages uniqueness. An issue arises when manual submenu are created and don't have a view_id set. To avoid this issue, we now fallback on the initial page receives if no view is found. Forward-Port-Of: odoo/odoo#171556 Forward-Port-Of: odoo/odoo#171391
Description of the issue/feature this PR addresses: ------------------- Auto-cancelling Time Offs when editing public holidays was added in Jun 2022 ([see PR](https://github.com/odoo/odoo/pull/81225)) , but the cancellation of Time Offs wasn't updated to also remove the link to timesheets. If the user attempts to manually delete a timesheet linked to a Time Off (`holiday_id` in `hr.leave`), they will be asked to cancel the Time Off which by this point had already been auto-cancelled, and a
Original PR description
Description of the issue/feature this PR addresses: ------------------- Auto-cancelling Time Offs when editing public holidays was added in Jun 2022 ([see…
Description of the issue/feature this PR addresses: ------------------- Auto-cancelling Time Offs when editing public holidays was added in Jun 2022 ([see PR](https://github.com/odoo/odoo/pull/81225)) , but the cancellation of Time Offs wasn't updated to also remove the link to timesheets. If the user attempts to manually delete a timesheet linked to a Time Off (`holiday_id` in `hr.leave`), they will be asked to cancel the Time Off which by this point had already been auto-cancelled, and as long as the link exists (regardless of cancellation) the timesheet cannot be deleted from the user frontend. This PR adds an override call to unlink the timesheets before the leave (the inital validated timeoff) is force canceled. Current behavior before PR: ------------------- Steps to reproduce: 1. Create and validate an arbitrary Time Off, checking that it also creates a timesheet entry. 2. Create a new public holiday spanning the entire duration of the Time Off created in (1) 3. Attempt to delete the timesheet entry created in (1), if it is not already deleted. Although you will be asked to cancel the timeoff first, that is not possible because the timeoff will be auto-cancelled by this point, making the deletion of the timesheet impossible. Desired behavior after PR is merged: ------------------- At step 3, user should be able to delete the timesheet associated to the timeoff. Task-3697074 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#168223 Forward-Port-Of: odoo/odoo#154321
This commit is a follow up of its enterprise part. We add the user_context to the the params of the function to have access to the allowed_companies of the current user later on in the process. affected version: 15.0- master task - 361682 https://www.odoo.com/web#id=3631682&menu_id=4720&cids=1&action=333&active_id=4105&model=project.task&view_type=form Forward-Port-Of: odoo/odoo#170224 Forward-Port-Of: odoo/odoo#147768
Original PR description
This commit is a follow up of its enterprise part. We add the user_context to the the params of the function to have access to the allowed_companies of the current user later on in the process. affected version: 15.0- master task - 361682 https://www.odoo.com/web#id=3631682&menu_id=4720&cids=1&action=333&active_id=4105&model=project.task&view_type=form Forward-Port-Of: odoo/odoo#170224 Forward-Port-Of: odoo/odoo#147768
**Steps to reproduce:** - Open "Configure Document Layout" in settings. - Add only an image in the company_details section. **Issue:** - The customer added only an image to company_details in their production version 15.2. However, after migrating to version 17, the image appears in company_details but does not show up in the document preview. In version 15.2, there were some changes to company details that caused this issue https://github.com/odoo/odoo/pull/122438. - Due to these chan
Original PR description
**Steps to reproduce:** - Open "Configure Document Layout" in settings. - Add only an image in the company_details section. **Issue:** - The customer added only an image to company_details in their…
**Steps to reproduce:** - Open "Configure Document Layout" in settings. - Add only an image in the company_details section. **Issue:** - The customer added only an image to company_details in their production version 15.2. However, after migrating to version 17, the image appears in company_details but does not show up in the document preview. In version 15.2, there were some changes to company details that caused this issue https://github.com/odoo/odoo/pull/122438. - Due to these changes, company_details is processed with the html2plaintext() function, which removes all the tags from company_details and only links and text will remain. - This function does not recognize the image element and removes it along with other elements. I have prepared a fix that recognizes the image element from company_details and prevents it from getting discarded. - Video reference from RunBot version 17: https://drive.google.com/file/d/1Ml62xIV1mhwKwU8KRHdc-qfTFCZhEqY0/view?usp=sharing - I have also added a test case for html2plaintext function in test_html2plaintext function by backporting this method from master. OPW : [3945490](https://www.odoo.com/odoo/my-tasks/3945490?cids=2) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#171440 Forward-Port-Of: odoo/odoo#169027
The checksum flag does not exists in older Docker versions. Forward-Port-Of: odoo/odoo#171627
Original PR description
The checksum flag does not exists in older Docker versions. Forward-Port-Of: odoo/odoo#171627
Versions -------- - 15.0 - 16.0 - 17.0 - saas-17.1 - saas-17.2 - saas-17.3 Issue ----- Commit 9426ee54b927 introduced the \uFEFF character to web_editor as a zero-width non-breaking whitespace. When this gets added to a HTML node, and processed for translation, it throws an "empty document" error. Cause ----- When passed to the `get_text_content` function, the call to `html.fromstring('\uFEFF').text_content()` throws an error. \uFEFF is not technically classified as whitespace
Original PR description
Versions
--------
- 15.0
- 16.0
- 17.0
- saas-17.1
- saas-17.2
- saas-17.3
Issue
-----
Commit 9426ee54b927 introduced the \uFEFF character to web_editor as a zero-width non-breaking whitespace. When this gets added to a HTML node, and processed for translation, it throws an "empty document" error.
Cause
-----
When passed to the `get_text_content` function, the call to `html.fromstring('\uFEFF').text_content()` throws an error. \uFEFF is not technically classified as whitespace, so the `nonspace` function which attempts to prevent processing empty documents doesn't catch it.
Solution
--------
Instead of the `isspace` method, use a regex which matches on all whitespace as well as \uFEFF.
To be applied on stable versions while the origins of stray ZWNBSPs get tackled on master.
opw-3957259
Forward-Port-Of: odoo/odoo#171578
Forward-Port-Of: odoo/odoo#169122Add a domain so deprecated accounts aren't suggested in expenses. task-3974053 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#171557 Forward-Port-Of: odoo/odoo#168704
Original PR description
Add a domain so deprecated accounts aren't suggested in expenses. task-3974053 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#171557 Forward-Port-Of: odoo/odoo#168704
SDI does not accept negative lines. But people use it to define flat global discount. We reuse the logic from l10n_mx_edi, so we move it to account. It will now try to create a flat discount for other lines that have the same tax. [Task link](https://www.odoo.com/odoo/project.task/3943357) task-3943357 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#168939
Original PR description
SDI does not accept negative lines. But people use it to define flat global discount. We reuse the logic from l10n_mx_edi, so we move it to account. It will now try to create a flat discount for other lines that have the same tax. [Task link](https://www.odoo.com/odoo/project.task/3943357) task-3943357 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#168939
The German delivery slips only show the company address, not the actual delivery address. ### Steps to reproduce: - Install l10n_de and switch to a German company - Create a delivery address to a company - Create a new SO, select the company as the customer and validate - Go to the created Delivery order, the delivery address should be the one you created before - Validate and print the delivery slip ### Cause: The German document format is DIN 5008 and this format does not include t
Original PR description
The German delivery slips only show the company address, not the actual delivery address. ### Steps to reproduce: - Install l10n_de and switch to a German company - Create a delivery address to a company - Create a new SO, select the company as the customer and validate - Go to the created Delivery order, the delivery address should be the one you created before - Validate and print the delivery slip ### Cause: The German document format is DIN 5008 and this format does not include the delivery address on the slips. ### Solution: Add the delivery address in the additional addresses that should be printed. opw-3961185 Forward-Port-Of: odoo/odoo#170902
When the grid mode was added in commit [1], the "Padding" grid option was impacting all the grid items at the same time. This was not looking good in the "Masonry" snippet, because the images would have the same padding as the text grid items, while it would look better if they could take the whole space. The padding was therefore forced to 0 px for this snippet images (see commit [2]), preventing this option from having an impact on them. However, the "Padding" option was improved in commit
Original PR description
When the grid mode was added in commit [1], the "Padding" grid option was impacting all the grid items at the same time. This was not looking good in the "Masonry" snippet, because the images would…
When the grid mode was added in commit [1], the "Padding" grid option was impacting all the grid items at the same time. This was not looking good in the "Masonry" snippet, because the images would have the same padding as the text grid items, while it would look better if they could take the whole space. The padding was therefore forced to 0 px for this snippet images (see commit [2]), preventing this option from having an impact on them. However, the "Padding" option was improved in commit [3], allowing the padding to be set on the grid items individually. There is therefore no need to block this option for the "Masonry" images anymore. This commit removes the CSS rules preventing the "Padding" option from being applied on "Masonry" images. Note that the default padding is still set to 0 px, as it looks better, but it can now be modified with the option. Also note that the CSS rule about not showing the padding highlights was not working, as it was forgotten and not adapted when doing commit [3]. [1]: https://github.com/odoo/odoo/commit/cc406afcea7bf5846233a9f97a4a8ac5f618f3ec [2]: https://github.com/odoo/odoo/commit/85b352af319edec84407f2046cf795b4e5503460 [3]: https://github.com/odoo/odoo/commit/11418cc6f0afcc8e14869f4f38ae0d6d462ac712 task-3970022 Forward-Port-Of: odoo/odoo#168013
This commit addresses an issue where events removed due to changes in their recurrence rules from Google, and those cancelled separately on Google, could be attempted to be cancelled twice in Odoo. opw-3997021 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#171240
Original PR description
This commit addresses an issue where events removed due to changes in their recurrence rules from Google, and those cancelled separately on Google, could be attempted to be cancelled twice in Odoo. opw-3997021 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#171240
To reproduce: ============= - share a project with a portal user - connect as the portal user - on a task paste an image in the description - save -> AccessError Problem: ======== Portal user doesn't have the right to create attachments Solution: ========= - when saving the record, editor tries to save the image as an attachment by `POST` request on the route `/web_editor/attachment/add_image` - `/web_editor/attachment/add_image` is not dedicated to portal user, so the save met
Original PR description
To reproduce: ============= - share a project with a portal user - connect as the portal user - on a task paste an image in the description - save -> AccessError Problem: ======== Portal user doesn't have the right to create attachments Solution: ========= - when saving the record, editor tries to save the image as an attachment by `POST` request on the route `/web_editor/attachment/add_image` - `/web_editor/attachment/add_image` is not dedicated to portal user, so the save method is patched to modify the route to custom one `/project_sharing/attachment/add_image` opw-3774447 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#170497
Problem: For an Italian public company, when sending an invoice there is no warning triggered when the field "Origin Document Type" is empty Steps to reproduce: - Install "Contacts" and "Accounting" apps - Create an Italian company and set its fiscal localization - Create a new Italian contact and fill out the "Destination Code" with a six-digit code - Create an invoice for this contact, in the "Electronic Invoicing" tab, leave the field "Origin Document Type" empty - Confirm the invoic
Original PR description
Problem: For an Italian public company, when sending an invoice there is no warning triggered when the field "Origin Document Type" is empty Steps to reproduce: - Install "Contacts" and "Accounting"…
Problem: For an Italian public company, when sending an invoice there is no warning triggered when the field "Origin Document Type" is empty Steps to reproduce: - Install "Contacts" and "Accounting" apps - Create an Italian company and set its fiscal localization - Create a new Italian contact and fill out the "Destination Code" with a six-digit code - Create an invoice for this contact, in the "Electronic Invoicing" tab, leave the field "Origin Document Type" empty - Confirm the invoice and click on "Send & Print", there is no warning saying that the field "Origin Document Type" must be filled out Cause: Errors in the conditions Note: Modification in the get_records_action because self.id returns an id of type NewId which raise an error (see below) in this fix workflow because it is called in an onchange function. self.ids[0] returns an id of type int Error raised: TypeError: Object of type NewId is not JSON serializable Steps to reproduce: - Do the 4 first steps as above - Create a second invoice with another customer which is not a public italian administration (can be from another country) - Select the invoices and click on "Send & Print" in the "Actions" button opw-3844664 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#162776
Following the changes introduced in https://github.com/odoo/odoo/commit/5a452e9baecb32d3a7de7b975841a1a981b20dcc, archived product template attribute values were not being loaded, leading to errors when loading paid orders. opw-4012873 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#171427
Original PR description
Following the changes introduced in https://github.com/odoo/odoo/commit/5a452e9baecb32d3a7de7b975841a1a981b20dcc, archived product template attribute values were not being loaded, leading to errors when loading paid orders. opw-4012873 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#171427
This commit fixes two things: 1- Allow for importing V3.2.2 Factura-E. 2- While importing, if the customer doesn't exist in our database, we create it. The country and the VAT were never set correctly as the country code is in three letter format in the XML and two letter format in Odoo. task-4011534 Forward-Port-Of: odoo/odoo#170744
Original PR description
This commit fixes two things: 1- Allow for importing V3.2.2 Factura-E. 2- While importing, if the customer doesn't exist in our database, we create it. The country and the VAT were never set correctly as the country code is in three letter format in the XML and two letter format in Odoo. task-4011534 Forward-Port-Of: odoo/odoo#170744
**Steps to reproduce:** - Install Invoicing - Go to "Settings / Technical / Email / Email Templates" - Open "Invoicing: Sending" - In "Email Configuration" tab, remove value of "To (Partners)" [partner_to] and add a placeholder for "To (Emails)" [email_to] For example: {{ object.partner_id.email }}) - Create an invoice and open "Send & Print" wizard **Issue:** Recipients field is empty. It should contain customer's email. Same issue with "Cc" [email_cc] field of email template. **Ca
Original PR description
**Steps to reproduce:**
- Install Invoicing
- Go to "Settings / Technical / Email / Email Templates"
- Open "Invoicing: Sending"
- In "Email Configuration" tab, remove value of "To (Partners)" [partner_to] and add a placeholder for "To (Emails)" [email_to] For example: {{ object.partner_id.email }})
- Create an invoice and open "Send & Print" wizard
**Issue:**
Recipients field is empty. It should contain customer's email.
Same issue with "Cc" [email_cc] field of email template.
**Cause:**
When generating the recipients of "Send & Print" wizard, the placeholder defined in email_to field of the email template is not evaluated.
opw-3999260
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#171485This error occurs when the user drag & drop the newly created calendar event and select ``This and Following events`` in ``Edit Recurrent event`` Steps to reproduce: - Install ``Calendar`` module - Create a new event from the Calendar view - Edit event -> Enable ``Recurrent`` - Now click on any day from ``Repeat on`` and remove the day which is selected by default (eg: if Tuesday is the default then select Monday and unselect Tuesday) - Save and Unarchive it and go back to the calend
Original PR description
This error occurs when the user drag & drop the newly created calendar event and select ``This and Following events`` in ``Edit Recurrent event`` Steps to reproduce: - Install ``Calendar`` module -…
This error occurs when the user drag & drop the newly created calendar event and select ``This and Following events`` in ``Edit Recurrent event`` Steps to reproduce: - Install ``Calendar`` module - Create a new event from the Calendar view - Edit event -> Enable ``Recurrent`` - Now click on any day from ``Repeat on`` and remove the day which is selected by default (eg: if Tuesday is the default then select Monday and unselect Tuesday) - Save and Unarchive it and go back to the calendar view - Now drag & drop the newly created event to anywhere and select ``This and Following events`` in ``Edit Recurrent event`` Traceback: ``ValueError: not enough values to unpack (expected 1, got 0)`` The error on line [1] occurs because ``recurrence_id`` is not found in ``self``. This issue stems from a change made in commit [2], where ``recurrency`` was set to ``True``. Consequently, when an event is archived, ``recurrency`` remains ``True``, but the event lacks a ``recurrence_id``. This absence of ``recurrence_id`` in ``self`` at line [1] triggers an error. However, before this commit, the expected behavior was that when an event is archived, ``recurrency`` should be set to ``False``. This commit will fix the error by passing ``false`` for ``update_recurrence`` when ``recurrence_id`` is not present. [1]: https://github.com/odoo/odoo/blob/d7cfef9c51461a595f3f46c7b91e5c56241d4af3/addons/calendar/models/calendar_event.py#L1196 [2]: https://github.com/odoo/odoo/commit/48e3f725a2506ca63336a131661542cacc6f1ab5 sentry-5462902179 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#169040
Before this PR, the live chat support page test was sometimes failing. This test ensures all the Odoo modules are successfully loaded on the support page. Until now, the test was waiting 1 second, which might be enough to load Odoo modules but not all the live chat assets. If the live chat assets are still loading when the browser instance is closed, the promise rejects and the test fails. This test now ensures all the live chat assets are loaded beforehand. This change is beneficial becau
Original PR description
Before this PR, the live chat support page test was sometimes failing. This test ensures all the Odoo modules are successfully loaded on the support page. Until now, the test was waiting 1 second, which might be enough to load Odoo modules but not all the live chat assets. If the live chat assets are still loading when the browser instance is closed, the promise rejects and the test fails. This test now ensures all the live chat assets are loaded beforehand. This change is beneficial because it also ensures that runtime assets such as translations, live chat CSS, or fonts are properly loaded as well. This PR fixes this issue. runbot-60514 Forward-Port-Of: odoo/odoo#171372
**Traceback:** ```python ('helpdesk.helpdesk_team_menu', 393, 'Helpdesk > Configuration > Helpdesk Teams', 559): Traceback (most recent call last): File "/tmp/tmpkjz256np/migrations/base/tests/test_mock_crawl.py", line 255, in crawl_menu self.mock_action(action_vals) File "/tmp/tmpkjz256np/migrations/base/tests/test_mock_crawl.py", line 412, in mock_action mock_method(model, view, fields_list, domain, group_by) File "/tmp/tmpkjz256np/migrations/base/tests/test_mock_craw
Original PR description
**Traceback:** ```python ('helpdesk.helpdesk_team_menu', 393, 'Helpdesk > Configuration > Helpdesk Teams', 559): Traceback (most recent call last): File…
**Traceback:**
```python
('helpdesk.helpdesk_team_menu', 393, 'Helpdesk > Configuration > Helpdesk Teams', 559):
Traceback (most recent call last):
File "/tmp/tmpkjz256np/migrations/base/tests/test_mock_crawl.py", line 255, in crawl_menu
self.mock_action(action_vals)
File "/tmp/tmpkjz256np/migrations/base/tests/test_mock_crawl.py", line 412, in mock_action
mock_method(model, view, fields_list, domain, group_by)
File "/tmp/tmpkjz256np/migrations/base/tests/test_mock_crawl.py", line 441, in mock_view_form
[data] = record.read(fields_list)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 3540, in read
return self._read_format(fnames=fields, load=load)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 3751, in _read_format
vals[name] = convert(record[name], record, use_display_name)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 6631, in __getitem__
return self._fields[key].__get__(self, self.env.registry[self._name])
File "/home/odoo/src/odoo/17.0/odoo/fields.py", line 1207, in __get__
self.compute_value(recs)
File "/home/odoo/src/odoo/17.0/odoo/fields.py", line 1389, in compute_value
records._compute_field_value(self)
File "/home/odoo/src/odoo/17.0/addons/mail/models/mail_thread.py", line 424, in _compute_field_value
return super()._compute_field_value(field)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4875, in _compute_field_value
fields.determine(field.compute, self)
File "/home/odoo/src/odoo/17.0/odoo/fields.py", line 102, in determine
return needle(*args)
File "/home/odoo/src/enterprise/17.0/helpdesk_timesheet/models/helpdesk_team.py", line 22, in _compute_total_timesheet_time
[('helpdesk_ticket_id', 'in', helpdesk_timesheet_teams.ticket_ids.filtered(lambda x: not x.stage_id.fold).ids)],
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 6110, in filtered
return self.browse([rec.id for rec in self if func(rec)])
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 6110, in <listcomp>
return self.browse([rec.id for rec in self if func(rec)])
File "/home/odoo/src/enterprise/17.0/helpdesk_timesheet/models/helpdesk_team.py", line 22, in <lambda>
[('helpdesk_ticket_id', 'in', helpdesk_timesheet_teams.ticket_ids.filtered(lambda x: not x.stage_id.fold).ids)],
File "/home/odoo/src/odoo/17.0/odoo/fields.py", line 2907, in __get__
return super().__get__(records, owner)
File "/home/odoo/src/odoo/17.0/odoo/fields.py", line 1182, in __get__
recs._fetch_field(self)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 3777, in _fetch_field
self.fetch(fnames)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 3827, in fetch
fetched = self._fetch_query(query, fields_to_fetch)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 3920, in _fetch_query
rows = self.env.cr.fetchall()
MemoryError
```
**Summary of changes:**
Previously, the code `helpdesk_timesheet_teams.ticket_ids.filtered( lambda x: not x.stage_id.fold).ids)` generating O(n) queries leading to a memory error when dealing with large numbers of tickets (e.g., 60k+ for this customer).
This commit refactors the code to use the search method instead. this approach reduces the number of queries to O(1) and significantly improves performance for customers with a large number of helpdesk tickets.
UPG - [1776915](https://upgrade.odoo.com/web#id=1776915&cids=1&menu_id=107&action=150&model=upgrade.request&view_type=form)
TASK - [3995988](https://www.odoo.com/odoo/my-tasks/3995988?cids=2)
Forward-Port-Of: odoo/enterprise#65615Steps to reproduce: - install timesheet module - install project_timesheet_forecast bridge module - open timesheets - click on all timesheets - search an employee name Issue: - employees that are not matching this search are still being displayed Cause: - the conditions that are in domain causes this issue Solution: - if we gave the condition in domain ,that the filter is based on related search then the issue will be solved task-3653034 Forward-Port-Of: odoo/enterprise#533
Original PR description
Steps to reproduce: - install timesheet module - install project_timesheet_forecast bridge module - open timesheets - click on all timesheets - search an employee name Issue: - employees that are not matching this search are still being displayed Cause: - the conditions that are in domain causes this issue Solution: - if we gave the condition in domain ,that the filter is based on related search then the issue will be solved task-3653034 Forward-Port-Of: odoo/enterprise#53376
This commit's purpose is to disable the helpdesk ticket creation command when there are no teams available for the current connected user. Currently, using this command this way will create a new ticket without any team attached, rendering it useless. step to reproduce: - install helpdesk application - open helpdesk - open confifuration menu, select helpdesk team - select 'customer care' - activate the livechat option and saves - leave helpdesk - change from the current active company
Original PR description
This commit's purpose is to disable the helpdesk ticket creation command when there are no teams available for the current connected user. Currently, using this command this way will create a new…
This commit's purpose is to disable the helpdesk ticket creation command when there are no teams available for the current connected user. Currently, using this command this way will create a new ticket without any team attached, rendering it useless. step to reproduce: - install helpdesk application - open helpdesk - open confifuration menu, select helpdesk team - select 'customer care' - activate the livechat option and saves - leave helpdesk - change from the current active company to any other company that doesn't have any helpdesk team with the livechat feature enabled - open the discuss app and select the 'general' discussion - type /helpdesk your_ticket a new ticket will be created without any team linked to it. source of the issue: when a team has the livechat option enable, the command is added to the livechat regardless of the connected user's access right to the team. solution: Only add the command to the list of livechat command if the user has access to at least one team with the livechat feature enable. affected version : 15.0 - master task - 3631682 https://www.odoo.com/web#id=3631682&menu_id=4720&cids=1&action=333&active_id=4105&model=project.task&view_type=form Forward-Port-Of: odoo/enterprise#65137 Forward-Port-Of: odoo/enterprise#53510
To reproduce the bug: - Have payroll and its l10n-au additional modules installed - Go to payroll -> config -> structure types - Change the first element 'Default Scheduled Pay' to semi-annually - Go to contacts and create click on New A python traceback will show. That's due to giving the PERIODS_PER_YEAR dictionary a non-existent key. As we can see, it lacks 'semi-monthly', 'bi-monthly', and 'semi-annually' periods. opw-4015682 Forward-Port-Of: odoo/enterprise#65618
Original PR description
To reproduce the bug: - Have payroll and its l10n-au additional modules installed - Go to payroll -> config -> structure types - Change the first element 'Default Scheduled Pay' to semi-annually - Go to contacts and create click on New A python traceback will show. That's due to giving the PERIODS_PER_YEAR dictionary a non-existent key. As we can see, it lacks 'semi-monthly', 'bi-monthly', and 'semi-annually' periods. opw-4015682 Forward-Port-Of: odoo/enterprise#65618
# Description Previously, attempting to re-insert a list containing NaN values would cause multiple traceback errors. To resolve this, an error message will now be displayed in the input dialog when the user tries to insert a list with invalid numbers. Task: [4008696](https://www.odoo.com/odoo/project/2328/tasks/4008696?cids=2) Forward-Port-Of: odoo/enterprise#65592
Original PR description
# Description Previously, attempting to re-insert a list containing NaN values would cause multiple traceback errors. To resolve this, an error message will now be displayed in the input dialog when the user tries to insert a list with invalid numbers. Task: [4008696](https://www.odoo.com/odoo/project/2328/tasks/4008696?cids=2) Forward-Port-Of: odoo/enterprise#65592
Versions -------- - 17.0 - saas-17.1 - saas-17.2 - saas-17.3 Steps ----- 1. Go to timesheets; 2. go to list view; 3. edit a timesheet line. Issue ----- `UncaughtPromiseError` Cause ----- Commit bae2e8146d48 added the `onRecordChanged` method, which fixed the issue of the timer not recording time spent on a project. The issue is that this method is also called when changing a row from the list view, and there's no `timesheet` value set by the timer, causing an error when
Original PR description
Versions -------- - 17.0 - saas-17.1 - saas-17.2 - saas-17.3 Steps ----- 1. Go to timesheets; 2. go to list view; 3. edit a timesheet line. Issue ----- `UncaughtPromiseError` Cause ----- Commit bae2e8146d48 added the `onRecordChanged` method, which fixed the issue of the timer not recording time spent on a project. The issue is that this method is also called when changing a row from the list view, and there's no `timesheet` value set by the timer, causing an error when trying to access `this.timesheet.resId`. Solution -------- Check `this.timerState.timesheetId` instead of `this.timesheet.resId`. `this.timerState` is guaranteed to exist, and its `timesheetId` value will be `undefined` if the timer isn't running, skipping the timer-specific logic. Also handle default projects when set. opw-4027099 Forward-Port-Of: odoo/enterprise#65879
To allow other localizations to use the same logic for negative lines, we moved the methods in account. We still extend it in the module to add specific logic about taxes and documents. task-3943357 Forward-Port-Of: odoo/enterprise#64379
Original PR description
To allow other localizations to use the same logic for negative lines, we moved the methods in account. We still extend it in the module to add specific logic about taxes and documents. task-3943357 Forward-Port-Of: odoo/enterprise#64379
This PR introduces a `l10n` test over the Balance Sheet reports. Each Balance Sheet report in the `LOC_DATA` global at the head of the file will be tested. The test generates a journal entry with a line in every account that is not `off_balance`. It then checks whether the Balance Sheet is balanced. The test does this both for debits and for credits. The test will give a warning for any installed Balance Sheet report which is not specified in the LOC_DATA global. The aim is to change th
Original PR description
This PR introduces a `l10n` test over the Balance Sheet reports. Each Balance Sheet report in the `LOC_DATA` global at the head of the file will be tested. The test generates a journal entry with a…
This PR introduces a `l10n` test over the Balance Sheet reports.
Each Balance Sheet report in the `LOC_DATA` global at the head of the file will be tested.
The test generates a journal entry with a line in every account that is not `off_balance`.
It then checks whether the Balance Sheet is balanced.
The test does this both for debits and for credits.
The test will give a warning for any installed Balance Sheet report which is not specified in the LOC_DATA global. The aim is to change this to an error once all existing Balance Sheets are tested, to make this test mandatory for any new localizations.
For each localization with a Balance Sheet, the test needs to know the XMLIDs of:
- the CoA
- the Balance Sheet report
- the Total Assets line of the Balance Sheet
- the Total Liabilities line of the Balance Sheet
- the Total Equity line of the Balance Sheet (if applicable)
Setting the global `IDENTIFY_INCORRECT_ACCOUNTS` to `True` switches the behaviour of the test: it identifies the accounts that cause the imbalance using a binary search. This is off by default for runbot.
**Performance impact**
- For each Balance Sheet, the test does the following:
- load the chart template
- create an account.move with 4 AMLs for each account (one debit and credit in the account; and one debit and credit in the counterpart account)
- generate the report once.
- The Binary Search (which can be toggled when testing locally) is quite efficient:
- If there is just one incorrect account, then the report needs to be generated `log2(<number of accounts>)` times.
- If there are `X` incorrect accounts, then in the worst-case the report may need to be generated `X * log2(<number of accounts>)` times.
On the Belgian CoA, with no incorrect accounts, the test takes 14s on my PC. With 4 incorrect accounts, the test takes 33s.
Task: 3060790
Forward-Port-Of: odoo/enterprise#65863
Forward-Port-Of: odoo/enterprise#36838Problem --------- `_get_digital_signature` currently returns a sudo certificate. This is not safe. Objective --------- Don't return a sudo certificate to anyone having access to this company. Forward-Port-Of: odoo/enterprise#65874 Forward-Port-Of: odoo/enterprise#65607
Original PR description
Problem --------- `_get_digital_signature` currently returns a sudo certificate. This is not safe. Objective --------- Don't return a sudo certificate to anyone having access to this company. Forward-Port-Of: odoo/enterprise#65874 Forward-Port-Of: odoo/enterprise#65607
PR #62452 (15.0+) added extra IAP calls that retry requesting the cancellation status in case the cancellation was not processed yet. In odoo/odoo#122663 (17.0+), IAP calls were disabled in tests. When fw-porting the first PR above, this change of behaviour in 17.0 was not taken into account meaning that the tests kept failing in 17.0+. We fix this by applying the same strategy as #62452 - patch the thread to remove the testing attribute during IAP calls. runbot-64793 Forward-Port-O
Original PR description
PR #62452 (15.0+) added extra IAP calls that retry requesting the cancellation status in case the cancellation was not processed yet. In odoo/odoo#122663 (17.0+), IAP calls were disabled in tests. When fw-porting the first PR above, this change of behaviour in 17.0 was not taken into account meaning that the tests kept failing in 17.0+. We fix this by applying the same strategy as #62452 - patch the thread to remove the testing attribute during IAP calls. runbot-64793 Forward-Port-Of: odoo/enterprise#65867
Add a currency rates update method using the BCU (Banco Central Uruguayo) webservices for Uruguay (UY). Webservices used: - Get last currency rate update date https://cotizaciones.bcu.gub.uy/wscotizaciones/servlet/awsultimocierre - Get rates https://cotizaciones.bcu.gub.uy/wscotizaciones/servlet/awsbcucotizaciones Latest PDF specification [here](https://drive.google.com/file/d/122UtHhpdYEmbOti0nr0d-brZs65kiLDT/view) Rates can be manually verified [here](https://www.bcu.gub.uy/Esta
Original PR description
Add a currency rates update method using the BCU (Banco Central Uruguayo) webservices for Uruguay (UY). Webservices used: - Get last currency rate update date https://cotizaciones.bcu.gub.uy/wscotizaciones/servlet/awsultimocierre - Get rates https://cotizaciones.bcu.gub.uy/wscotizaciones/servlet/awsbcucotizaciones Latest PDF specification [here](https://drive.google.com/file/d/122UtHhpdYEmbOti0nr0d-brZs65kiLDT/view) Rates can be manually verified [here](https://www.bcu.gub.uy/Estadisticas-e-Indicadores/Paginas/Cotizaciones.aspx) For questions or updated specifcations, please send an email to mesadeayuda@bcu.gub.uy *Note: the `CodigoISO` tag isn't a reliable ISO code, that's why we use their specific `Moneda` currency code instead.* Credits to **Adhoc** for the development. Original PR: odoo/enterprise#49519 Forward-Port-Of: odoo/enterprise#65169
The issue: When there is a validation error happened directly with the DIAN, the error message is DIAN_RESULT, which does not explain much to the client. The Fix: explain to the client what is a DIAN_RESULT error opw-3921726 Forward-Port-Of: odoo/enterprise#65632 Forward-Port-Of: odoo/enterprise#65547
Original PR description
The issue: When there is a validation error happened directly with the DIAN, the error message is DIAN_RESULT, which does not explain much to the client. The Fix: explain to the client what is a DIAN_RESULT error opw-3921726 Forward-Port-Of: odoo/enterprise#65632 Forward-Port-Of: odoo/enterprise#65547
The coverage reports do not print the right account ids when searching for the ones that are not used. ### Steps to reproduce: - Install the 'l10n_de' module and switch to a German company - Go in Accounting > Configuration > Management > Accounting Reports - Go in the German Profit and Loss report - Click on the button 'Accounts Coverage Report' - In the downloaded report the yellow lines should not appear as they are linked ### Cause: When searching for the ids that are not linked,
Original PR description
The coverage reports do not print the right account ids when searching for the ones that are not used. ### Steps to reproduce: - Install the 'l10n_de' module and switch to a German company - Go in Accounting > Configuration > Management > Accounting Reports - Go in the German Profit and Loss report - Click on the button 'Accounts Coverage Report' - In the downloaded report the yellow lines should not appear as they are linked ### Cause: When searching for the ids that are not linked, the code actually only look up the ones that are linked to an account. ### Solution: Fix the condition on the ids. opw-3993835 Forward-Port-Of: odoo/enterprise#65628
### Original issue: When creating a debit note on a bill from a purchase order with the option 'copy_lines', the field 'Purchase Order' in the lines is not populated. ### Steps to reproduce: - Install Purchase, Inventory apps and the l10n_co_edi module - Switch to a Colombian company - Go to Accounting > Configuration > Accounting > Journals - In the Vendor Bill journal > Advanced Settings, uncheck the 'Electronic invoicing UBL 2.1 (Colombia)' option - Go to Purchase > Orders > Purchase
Original PR description
### Original issue: When creating a debit note on a bill from a purchase order with the option 'copy_lines', the field 'Purchase Order' in the lines is not populated. ### Steps to reproduce: -…
### Original issue:
When creating a debit note on a bill from a purchase order with the option 'copy_lines', the field 'Purchase Order' in the lines is not populated.
### Steps to reproduce:
- Install Purchase, Inventory apps and the l10n_co_edi module
- Switch to a Colombian company
- Go to Accounting > Configuration > Accounting > Journals
- In the Vendor Bill journal > Advanced Settings, uncheck the 'Electronic invoicing UBL 2.1 (Colombia)' option
- Go to Purchase > Orders > Purchase Orders, create a new one and confirm it
- 'Receive Products' and 'Validate'
- Go back to the Purchase order
- 'Create Bill' and 'Confirm'
- From actions, choose 'Debit Note'
- In the wizard, tick 'Copy Lines', select a 'Concepto Nota de Débito' and 'Create Debit Note'
- Display the Purchase Order field in the Invoice Line tab is visible, it should not be populated
### Cause:
This bug is due to another fix that have been badly made because no tests were there. Most of the content of enterprise/l10n_co_edi/wizards/account_debit_note.py:_prepare_default_values is not called when it is supposed to and called when it's not.
In the 'Create Debit Note' wizard view there is an option to copy the lines and so, autopopulate them. This option is not displayed for Debit Notes generated from Credit Notes because the lines would be negative.
(https://github.com/odoo/odoo/blob/47eff65afdba3a2a8283342d8b636657f1fac317/addons/account_debit_note/wizard/account_debit_note_view.xml#L16)
The logic of this option is located in the module account_debit_note: https://github.com/odoo/odoo/blob/2a02ba4de1c823bcdef0e8b6b6373fa27b5587a1/addons/account_debit_note/wizard/account_debit_note.py#L64, the line_ids value is filled with a default value if copy_lines is False. If left empty, the lines are copied from the original account.move.
In this commit, https://github.com/odoo/enterprise/commit/c738f14d4ac88d508b6b75747788f5867eb71a68 we are trying to manually populate the lines of a debit note when it is generated from a credit note. But the code is made so that the lines are always copied.
So in this other commit https://github.com/odoo/enterprise/commit/fa65a1ff8cb7333a3339438513d1eeb5d5f9690e there is a correction to take the copy_lines into consideration. But it breaks the precedent fix as Debit Notes of Credit Notes always have copy_lines to False. So the code to copy the lines manually is actually never called for Debit Notes of Credit Notes (which is the only case we want it to be called in). But is called every time copy_lines is set to True therefore ignoring the actual code to copy the lines in the module account_debit_note.
In the context of the bug of this PR, the problem comes from the manual copying of lines that is missing the value purchase_order_id.
### Solution:
Changing the logic of the _prepare_default_values function:
- if not a Colombian company or not a debit note of a credit note, stop here
- we let the logic in account_debit_note copy the lines (or not) depending on copy_lines.
- if the debit note comes from a credit note, we copy the lines and return
With this flow, the lines will not be copied manually so the value purchase_order_id will be populated.
opw-3962301
Forward-Port-Of: odoo/enterprise#65528
Forward-Port-Of: odoo/enterprise#64689The module depends on documents_spreadsheet and crm in the manifest but contains references for [fields](https://github.com/odoo/enterprise/blob/a935055b1ea60b799e5c61c46a09231c4d210095/documents_spreadsheet_crm/data/files/pipeline_revenue_report_template.json#L280) defined in [crm_enterprise](https://github.com/odoo/enterprise/blob/a935055b1ea60b799e5c61c46a09231c4d210095/crm_enterprise/models/crm_lead.py#L10) and relies on the autoinstall of the enterprise module. The dependency should be expl
Original PR description
The module depends on documents_spreadsheet and crm in the manifest but contains references for [fields](https://github.com/odoo/enterprise/blob/a935055b1ea60b799e5c61c46a09231c4d210095/documents_spreadsheet_crm/data/files/pipeline_revenue_report_template.json#L280) defined in [crm_enterprise](https://github.com/odoo/enterprise/blob/a935055b1ea60b799e5c61c46a09231c4d210095/crm_enterprise/models/crm_lead.py#L10) and relies on the autoinstall of the enterprise module. The dependency should be explicit because crm_enterprise can be uninstalled by users and the documents would still be there with missing fields. Forward-Port-Of: odoo/enterprise#64549
With https://github.com/odoo/enterprise/pull/45256/files we broke the left scroll bar of the transactions. Both sides of the bank rec widget should have their own. Before the fix:  After the fix:  opw-4029287 Forward-Port-Of: odoo/enterprise#65901
Original PR description
With https://github.com/odoo/enterprise/pull/45256/files we broke the left scroll bar of the transactions. Both sides of the bank rec widget should have their own. Before the fix:  After the fix:  opw-4029287 Forward-Port-Of: odoo/enterprise#65901
When the website_sale_ups module is installed, it will conflict between the same code `this.codOptions` and throw the traceback on the payment page says 'Cannot read properties of undefined (reading 'classList')' related PR-https://github.com/odoo/enterprise/pull/56663 Forward-Port-Of: odoo/enterprise#65388
Original PR description
When the website_sale_ups module is installed, it will conflict between the same code `this.codOptions` and throw the traceback on the payment page says 'Cannot read properties of undefined (reading 'classList')' related PR-https://github.com/odoo/enterprise/pull/56663 Forward-Port-Of: odoo/enterprise#65388