Saturday, November 30, 2024
28 changes
1 change
Miscellaneous changes
In previous commit [1] we added text at the bottom of email sent when sending invoices, this doesn't work well for translation to have <a> tags in the middle of sentences, in particular in Dutch and German. We move the cliquable URL at the end of the sentence in an icon. [1]: https://github.com/odoo/odoo/commit/42cc1ea713aa977794231897b2f04758e30d8e19 task-no  Forward-Port-Of: odoo/odoo#189157
Original PR description
In previous commit [1] we added text at the bottom of email sent when sending invoices, this doesn't work well for translation to have <a> tags in the middle of sentences, in particular in Dutch and German. We move the cliquable URL at the end of the sentence in an icon. [1]: https://github.com/odoo/odoo/commit/42cc1ea713aa977794231897b2f04758e30d8e19 task-no  Forward-Port-Of: odoo/odoo#189157
16 changes
Resolved issues and error corrections
Helpdesk teams can now only include members from the same company as the team. This prevents tickets from being assigned to users who cannot access or see them, improving assignment accuracy in multi-company setups.
Original PR description
[FIX] heldepsk: Team members should be from the team company. Bug: You can add a Team Member from another company to a helpdesk team. Steps to reproduce: - Create two Companies, one User in each company - In the Helpdesk Team of Company 1 > Automatic Assignement > add also User from Company 2 - Connect to User 2 > he doesn't see the Tickets even if he is assigned to it Solution: - filter member_ids by the current company task-4207465
Miscellaneous changes
## Pull Request HOOT (PRHOOT) - part 27 Part 1: https://github.com/odoo/odoo/pull/152930 Part 2: https://github.com/odoo/odoo/pull/153018 Part 3: https://github.com/odoo/odoo/pull/153023 Part 4: https://github.com/odoo/odoo/pull/153203 Part 5: https://github.com/odoo/odoo/pull/153425 Part 6: https://github.com/odoo/odoo/pull/153700 Part 7: https://github.com/odoo/odoo/pull/154054 Part 8: https://github.com/odoo/odoo/pull/154579 Part 9: https://github.com/odoo/odoo/pull/155073 Part 10
Original PR description
## Pull Request HOOT (PRHOOT) - part 27 Part 1: https://github.com/odoo/odoo/pull/152930 Part 2: https://github.com/odoo/odoo/pull/153018 Part 3: https://github.com/odoo/odoo/pull/153023 Part 4:…
## Pull Request HOOT (PRHOOT) - part 27 Part 1: https://github.com/odoo/odoo/pull/152930 Part 2: https://github.com/odoo/odoo/pull/153018 Part 3: https://github.com/odoo/odoo/pull/153023 Part 4: https://github.com/odoo/odoo/pull/153203 Part 5: https://github.com/odoo/odoo/pull/153425 Part 6: https://github.com/odoo/odoo/pull/153700 Part 7: https://github.com/odoo/odoo/pull/154054 Part 8: https://github.com/odoo/odoo/pull/154579 Part 9: https://github.com/odoo/odoo/pull/155073 Part 10: https://github.com/odoo/odoo/pull/155639 Part 11: https://github.com/odoo/odoo/pull/156255 / https://github.com/odoo/enterprise/pull/58135 Part 12: https://github.com/odoo/odoo/pull/156869 Part 13: https://github.com/odoo/odoo/pull/158384 / https://github.com/odoo/enterprise/pull/59019 Part 14: https://github.com/odoo/odoo/pull/158916 Part 15: https://github.com/odoo/odoo/pull/160292 / https://github.com/odoo/enterprise/pull/59971 Part 15.5: https://github.com/odoo/odoo/pull/166463 Part 16: https://github.com/odoo/odoo/pull/166311 Part 17: https://github.com/odoo/odoo/pull/168328 Part 18: https://github.com/odoo/odoo/pull/171004 / https://github.com/odoo/enterprise/pull/65657 Part 19: https://github.com/odoo/odoo/pull/171242 / https://github.com/odoo/enterprise/pull/65767 Part 20: https://github.com/odoo/odoo/pull/173332 / https://github.com/odoo/enterprise/pull/66895 Part 21: https://github.com/odoo/odoo/pull/174337 Part 22: https://github.com/odoo/odoo/pull/176777 / https://github.com/odoo/enterprise/pull/68721 Part 23: https://github.com/odoo/odoo/pull/179660 / https://github.com/odoo/enterprise/pull/69728 Part 24: https://github.com/odoo/odoo/pull/181971 Part 25: https://github.com/odoo/odoo/pull/183358 Part 26: https://github.com/odoo/odoo/pull/186403 / https://github.com/odoo/enterprise/pull/73361 Community: https://github.com/odoo/odoo/pull/187034 This pull requests brings various improvements and fixes to Hoot and the Odoo unit test ecosystem. See the different commit messages for more details. Note: these changes are made in stable to avoid having to support multiple versions of the HOOT API. As such, these changes are intended to be strictly limited to unit tests as to not put the rest of the code base at risk. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/enterprise#74093
In safari (and all webkit navigators) `HTMLCanvasElement.toDataUrl` does not support `image/webp` as `type` parameter. https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL#browser_compatibility Before this commit, spreadsheet_edition/hooks.js:useSpreadsheetThumbnail draws an image to a canvas and convert it to base64. But the code assumes that the conversion to webp will work. `toDataUrl` uses `png` type if it doesn't work https://developer.mozilla.org/en-US/do
Original PR description
In safari (and all webkit navigators) `HTMLCanvasElement.toDataUrl` does not support `image/webp` as `type` parameter. https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL#browser_compatibility Before this commit, spreadsheet_edition/hooks.js:useSpreadsheetThumbnail draws an image to a canvas and convert it to base64. But the code assumes that the conversion to webp will work. `toDataUrl` uses `png` type if it doesn't work https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL#type With this commit, the regexp that removes the encoding data will supports `webp` **and** `png` Forward-Port-Of: odoo/enterprise#74870
Steps to reproduce: 1- Create 2 companies A and B 2- Create 2 employees (one for each company). 3- Assign 2 different values for billable_time_target to each employee. 4- Assign both employees to the same user 5- When the env company is A, the displayed value in leaderbord is the one from the user employee in company B instead of A (same as the env company) Source: - get_billable_time_target gets the values for all employees without filtering on the company, it returns a list and randoml
Original PR description
Steps to reproduce: 1- Create 2 companies A and B 2- Create 2 employees (one for each company). 3- Assign 2 different values for billable_time_target to each employee. 4- Assign both employees to the same user 5- When the env company is A, the displayed value in leaderbord is the one from the user employee in company B instead of A (same as the env company) Source: - get_billable_time_target gets the values for all employees without filtering on the company, it returns a list and randomly, the js takes the first value. Fix: - get_billable_time_target filters on env.company - get_all_billable_time_targets was also fixed to filter with env.company instead of env.user.company task-4222875 Forward-Port-Of: odoo/enterprise#71800
The "Projects" folder is currently hidden for everyone by default. This doesn't make sense, as we want people to have access to the folders of projects they have access to. This PR makes the folder read-only by default. Forward-Port-Of: odoo/enterprise#74890
Original PR description
The "Projects" folder is currently hidden for everyone by default. This doesn't make sense, as we want people to have access to the folders of projects they have access to. This PR makes the folder read-only by default. Forward-Port-Of: odoo/enterprise#74890
### Steps to reproduce the issue: 1. Activate Mexican Localization and switch to Mexican company 2. Create a POS Order or an Invoice in USD 3. Select the Order/Invoice and create a Global Invoice 4. Receive the error: > You can't process orders having a foreign currency. or > You can't process invoices having a foreign currency. ### Explanation: The intended behaviour, blocking multicurrency on Global Invoicing, was explained as an interdiction on foreign currencies.
Original PR description
### Steps to reproduce the issue: 1. Activate Mexican Localization and switch to Mexican company 2. Create a POS Order or an Invoice in USD 3. Select the Order/Invoice and create a Global Invoice 4. Receive the error: > You can't process orders having a foreign currency. or > You can't process invoices having a foreign currency. ### Explanation: The intended behaviour, blocking multicurrency on Global Invoicing, was explained as an interdiction on foreign currencies. ### Fix reasoning: Intended behaviour is to block the user when all `pos.order` or `account.move` do not have the same `currency_id`. opw-4302180 Forward-Port-Of: odoo/enterprise#73646
while signing a contract, it may happen that we end up with a sign request linked to multiple contracts. This will lead to an error when trying to call `_get_sign_request_folder` that has `ensure_one` on the contract. to avoid that we take the newest contract linked to the sign request. opw-4348211 Forward-Port-Of: odoo/enterprise#74755
Original PR description
while signing a contract, it may happen that we end up with a sign request linked to multiple contracts. This will lead to an error when trying to call `_get_sign_request_folder` that has `ensure_one` on the contract. to avoid that we take the newest contract linked to the sign request. opw-4348211 Forward-Port-Of: odoo/enterprise#74755
This commit fixes an issue with the social_linkedin module's comments fetch methods introduced in https://github.com/odoo/enterprise/pull/67079. This method disconnects the user from its account every time they open a post's comments, even if all API calls are successful. This shouldn't happen as nothing wrong happened to warrant a disconnection on our end. Now the user's account is disconnected if and only if there was an actual issue when fetching comments. task-4363737 Forward-Port-Of
Original PR description
This commit fixes an issue with the social_linkedin module's comments fetch methods introduced in https://github.com/odoo/enterprise/pull/67079. This method disconnects the user from its account every time they open a post's comments, even if all API calls are successful. This shouldn't happen as nothing wrong happened to warrant a disconnection on our end. Now the user's account is disconnected if and only if there was an actual issue when fetching comments. task-4363737 Forward-Port-Of: odoo/enterprise#74672
The tour would fail after 11pm as the smallest rental interval for the item is 1 hours leading to default dates leaking into the next day leading to more hours than planned being encoded. By forcing the date to be the first day of the next month we can ensure the date is always valid. Runbot Error 108371 Forward-Port-Of: odoo/enterprise#74860
Original PR description
The tour would fail after 11pm as the smallest rental interval for the item is 1 hours leading to default dates leaking into the next day leading to more hours than planned being encoded. By forcing the date to be the first day of the next month we can ensure the date is always valid. Runbot Error 108371 Forward-Port-Of: odoo/enterprise#74860
The attribute scales of the gantt view specifies which scales are available in the view. This means that for instance "year" or "month" can be absent from scales. If that happens and that "year" or "month" is the selected range, a crash occurs when rendering the GanttRendererControls component: TypeError: Cannot read properties of undefined (reading 'groupHeaderFormatter') Here we assign to each range a function groupHeaderFormatter so that we can call it independently from the available
Original PR description
The attribute scales of the gantt view specifies which scales are available in the view. This means that for instance "year" or "month" can be absent from scales. If that happens and that "year" or "month" is the selected range, a crash occurs when rendering the GanttRendererControls component:
TypeError: Cannot read properties of undefined (reading 'groupHeaderFormatter')
Here we assign to each range a function groupHeaderFormatter so that we can call it independently from the available scales.
Forward-Port-Of: odoo/enterprise#74689### Steps to reproduce: - In Accounting Dashboard, click on "import file" in the Bank kanban box - Select a CSV file with two missing values on a line, for example: ``` Transaction Type,Bank Reference,Narrative,Debit Amount,Credit Amount TRANSFER,bank_ref_1,bank_statement_line_1,,1000 TRANSFER,,bank_statement_line_2,,3500 ``` (missing `bank_ref_2`) - Complete the Odoo fields: Transaction Type, Reference, Label, Debit, Credit - Import - Go in Accounting Dashboard > Bank Reconciliation
Original PR description
### Steps to reproduce: - In Accounting Dashboard, click on "import file" in the Bank kanban box - Select a CSV file with two missing values on a line, for example: ``` Transaction Type,Bank…
### Steps to reproduce: - In Accounting Dashboard, click on "import file" in the Bank kanban box - Select a CSV file with two missing values on a line, for example: ``` Transaction Type,Bank Reference,Narrative,Debit Amount,Credit Amount TRANSFER,bank_ref_1,bank_statement_line_1,,1000 TRANSFER,,bank_statement_line_2,,3500 ``` (missing `bank_ref_2`) - Complete the Odoo fields: Transaction Type, Reference, Label, Debit, Credit - Import - Go in Accounting Dashboard > Bank Reconciliation and select the list view - `bank_statement_line_2` appears in Reference instead of Label ### Cause: In `_parse_import_data` some line values are added and some are expected to be removed. The values expected to be removed are stored by index but they are removed by value. In this case the index supposed to be removed is 3 but its value is empty like index 1. On the line `line.remove(line[index])` the first occurrence is removed, so index 1 is removed instead of 3. ### Solution: Use `del` to remove by index. opw-4319464 Forward-Port-Of: odoo/enterprise#74788 Forward-Port-Of: odoo/enterprise#74512
Reproduce --- - -i social - Social Marketing -> Add Stream - Add post -> give it a like on linkedin - BUG: Like information not fetched opw-4190850 Forward-Port-Of: odoo/enterprise#72491
Original PR description
Reproduce --- - -i social - Social Marketing -> Add Stream - Add post -> give it a like on linkedin - BUG: Like information not fetched opw-4190850 Forward-Port-Of: odoo/enterprise#72491
This commit reduces the number of read to a getter `editedRecord` which loops on all the record of the list to find the current one in edition. Forward-Port-Of: odoo/enterprise#74628 Forward-Port-Of: odoo/enterprise#74449
Original PR description
This commit reduces the number of read to a getter `editedRecord` which loops on all the record of the list to find the current one in edition. Forward-Port-Of: odoo/enterprise#74628 Forward-Port-Of: odoo/enterprise#74449
Before `_add_tax_details_in_base_line` populated tax details like `tax_amount_currency` directly, and `_round_base_lines_tax_details` subsequently moved these values to new keys prefixed with `raw_` while rounding the originals. The problem with that is the meaning of certain dictionary keys like `tax_amount_currency` changed depending on the method that processed them Now, `_add_tax_details_in_base_line` only adds raw values (e.g., `raw_tax_amount_currency`), and `_round_base_lines_tax_detai
Original PR description
Before `_add_tax_details_in_base_line` populated tax details like `tax_amount_currency` directly, and `_round_base_lines_tax_details` subsequently moved these values to new keys prefixed with `raw_` while rounding the originals. The problem with that is the meaning of certain dictionary keys like `tax_amount_currency` changed depending on the method that processed them Now, `_add_tax_details_in_base_line` only adds raw values (e.g., `raw_tax_amount_currency`), and `_round_base_lines_tax_details` separately adds the rounded values This simplifies state management and makes sure that raw and rounded values are clearly separated. related pr: https://github.com/odoo/odoo/pull/187780 task: 4277573 Forward-Port-Of: odoo/enterprise#74121
create account journal only if it doesn't exist related: https://github.com/odoo/upgrade/pull/6714 Forward-Port-Of: odoo/enterprise#74623
Original PR description
create account journal only if it doesn't exist related: https://github.com/odoo/upgrade/pull/6714 Forward-Port-Of: odoo/enterprise#74623
In the editor refactoring done in Odoo 18, we slightly changed the structure of the embedded props stored in the anchor node of the embedded views. Now, the view context is nested inside the `viewProps` attribute of the embedded props. When the user creates a copy of an article using the "Create a Copy" button, we iterate over all the embedded views stored in the article and we update the context of the embedded views. This way if they list the article items of the original article, they must
Original PR description
In the editor refactoring done in Odoo 18, we slightly changed the structure of the embedded props stored in the anchor node of the embedded views. Now, the view context is nested inside the…
In the editor refactoring done in Odoo 18, we slightly changed the structure of the embedded props stored in the anchor node of the embedded views. Now, the view context is nested inside the `viewProps` attribute of the embedded props. When the user creates a copy of an article using the "Create a Copy" button, we iterate over all the embedded views stored in the article and we update the context of the embedded views. This way if they list the article items of the original article, they must list the article items of the newly created article. This logic was introduced to allow people to start from a fresh and "ready-to-use" article. As the context has been moved in the embedded props, the check verifying if the embedded view has a context always fails and the references stored in the context are never updated. As a result, the newly created article has embedded views listing the article items of the original article which is not what we want. To fix the issue, we will read the context from the `viewProps` attribute of the embedded props and remove the last calls to `urllib` we made to encode/decode the embedded view props. Steps to reproduce: 1. Open Knowledge 2. Create an article 3. Insert an embedded view with `/kanban`, `/card` or `/list` 4. Create a few article items from the embedded view 5. Create a copy of the article you created at step 2 by clicking on the "Create a Copy" button from the kebab menu. => The embedded view in the new article lists the article items of the original article and not its own article items. TO BE: As it was the case before Odoo 18, the embedded views should list the article of the newly created article. see: https://github.com/odoo/enterprise/pull/42936 see: https://github.com/odoo/enterprise/pull/67083 task-4343222 Forward-Port-Of: odoo/enterprise#74044
11 changes
Resolved issues and error corrections
Incoming call invitation pop-ups now keep a consistent dark background with white text, instead of appearing transparent or switching to a bright style in dark mode. This makes call notifications easier to read and reduces visual discomfort for users using dark theme.
Original PR description
Call invitation was transparent because text-bg-900 is a backend-specific classname style. As a result, the pop-up had no bg-color. Also the background color and text looks good in white theme: black background with white text. This matches the colors in the call view. In dark theme the colors were inverted: white background and black text. This is unintentional, because this doesn't match call view color that is black color and white text in dark theme too. Also the main advantage of dark theme is to put less eye strain and the inverted colors in dark theme were actually more eye-straining than white theme. This commit fixes the issue by putting specific color in CSS. These colors should not change with theme: dark theme should keep dark background and white text. task-4354214
LinkedIn hashtag links generated from social posts now use LinkedIn's current link format. This helps ensure hashtags, including edge cases like short or mixed formats, open correctly for users viewing LinkedIn content.
Original PR description
With the current links generated for the hashtags in Linkedin, there's a few corner cases that are not being handled by Linkedin side as we expect it to (ex #FLD), so from 18.0 onwards we should follow the same formatting Linkedin is using nowadays. Previous link: https://www.linkedin.com/feed/hashtag/FLD2024 Link after the change: https://www.linkedin.com/feed/hashtag/?keywords=FLD2024 In the previous links you can see the differences between them. opw-4326960
Documentation and clarification updates
This pull request records that Kripal has signed the Contributor License Agreement. It is an administrative/legal update that helps ensure contributions can be accepted under Odoo's project rules.
Original PR description
Description of the issue/feature this PR addresses: This PR adds CLA signature. 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 pull request records Kripal's confirmation of signing the Contributor License Agreement. It is an administrative compliance update that supports contribution eligibility and does not change product behavior.
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
Miscellaneous changes
Revert the following fix: https://github.com/odoo/odoo/commit/5e3b471f4a67553d6f7525595b15dc3d7b4efb3f Which is no longer necessary since we have streams: https://github.com/odoo/odoo/commit/da8def8e410de68256ba4ab09ebf7a8b699355ac In particular, media must be returned with code 206 and a range, which is now the case. Forward-Port-Of: odoo/odoo#189063 Forward-Port-Of: odoo/odoo#188872
Original PR description
Revert the following fix: https://github.com/odoo/odoo/commit/5e3b471f4a67553d6f7525595b15dc3d7b4efb3f Which is no longer necessary since we have streams: https://github.com/odoo/odoo/commit/da8def8e410de68256ba4ab09ebf7a8b699355ac In particular, media must be returned with code 206 and a range, which is now the case. Forward-Port-Of: odoo/odoo#189063 Forward-Port-Of: odoo/odoo#188872
In the purchase tab of the sale view, the user can see UoMs of all categories for the vendor bill, but can only pick the one in the same category as the sales price unit, as other options will get silently reverted by an onchange. This is logical, but confusing for the user. The addition of a domain for the UoM category prevents units of other categories from appearing in the view. Partial backport of 33d7474b07abf8ae161364bcf29ae72cd04384ba opw: [4212814](https://www.odoo.com/odoo/project
Original PR description
In the purchase tab of the sale view, the user can see UoMs of all categories for the vendor bill, but can only pick the one in the same category as the sales price unit, as other options will get silently reverted by an onchange. This is logical, but confusing for the user. The addition of a domain for the UoM category prevents units of other categories from appearing in the view. Partial backport of 33d7474b07abf8ae161364bcf29ae72cd04384ba opw: [4212814](https://www.odoo.com/odoo/project/966/tasks/4212814) Forward-Port-Of: odoo/odoo#187857
In safari (and all webkit navigators) `HTMLCanvasElement.toDataUrl` does not support `image/webp` as `type` parameter. https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL#browser_compatibility Before this commit, spreadsheet_edition/hooks.js:useSpreadsheetThumbnail draws an image to a canvas and convert it to base64. But the code assumes that the conversion to webp will work. `toDataUrl` uses `png` type if it doesn't work https://developer.mozilla.org/en-US/do
Original PR description
In safari (and all webkit navigators) `HTMLCanvasElement.toDataUrl` does not support `image/webp` as `type` parameter. https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL#browser_compatibility Before this commit, spreadsheet_edition/hooks.js:useSpreadsheetThumbnail draws an image to a canvas and convert it to base64. But the code assumes that the conversion to webp will work. `toDataUrl` uses `png` type if it doesn't work https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL#type With this commit, the regexp that removes the encoding data will supports `webp` **and** `png` Forward-Port-Of: odoo/enterprise#74870
Problem: ======== when using pacs : Quadrum, SW Sapien some clients get their CFDI rejected because the schemaLocation is is containing more headers than needed. Solution: ========= We will only keep the needed schemaLocation for customer invoice, so headers for Payment and External Trade will be removed. opw-4168509 Forward-Port-Of: odoo/enterprise#74402 Forward-Port-Of: odoo/enterprise#72450
Original PR description
Problem: ======== when using pacs : Quadrum, SW Sapien some clients get their CFDI rejected because the schemaLocation is is containing more headers than needed. Solution: ========= We will only keep the needed schemaLocation for customer invoice, so headers for Payment and External Trade will be removed. opw-4168509 Forward-Port-Of: odoo/enterprise#74402 Forward-Port-Of: odoo/enterprise#72450
Reproduce --- - -i social - Social Marketing -> Add Stream - Add post -> give it a like on linkedin - BUG: Like information not fetched opw-4190850 Forward-Port-Of: odoo/enterprise#72491
Original PR description
Reproduce --- - -i social - Social Marketing -> Add Stream - Add post -> give it a like on linkedin - BUG: Like information not fetched opw-4190850 Forward-Port-Of: odoo/enterprise#72491
The query in `_get_invoice_matching_so_candidates` will frequently plan a Seq Scan because of the low selectivity of the conditions. And when it does not, the number of rows returned by the CTE is expected to high. Because of that, filtering the resulting rows by a sequence of `OR` conditions can quickly become slow. In this commit, the `OR` conditions are replaced by `LIKE(ANY(ARRAY[]))` conditions. That way the CTE is only referenced once in the conditions and applying the filter on each ro
Original PR description
The query in `_get_invoice_matching_so_candidates` will frequently plan a Seq Scan because of the low selectivity of the conditions. And when it does not, the number of rows returned by the CTE is…
The query in `_get_invoice_matching_so_candidates` will frequently plan a Seq Scan because of the low selectivity of the conditions. And when it does not, the number of rows returned by the CTE is expected to high. Because of that, filtering the resulting rows by a sequence of `OR` conditions can quickly become slow. In this commit, the `OR` conditions are replaced by `LIKE(ANY(ARRAY[]))` conditions. That way the CTE is only referenced once in the conditions and applying the filter on each row is way faster. We also discarded duplicated `text_tokens` to reduce the size of the `ARRAY`. The reason why using a `LIKE(ANY(ARRAY[]))` is faster is because postgres inlines the CTE in the outer query. This means that it performs a Seq Scan on sale.order and injects the CTE definition of sub.name inside the `WHERE` conditions of the outer query, along with injecting the `WHERE` conditions of the CTE. So, the regex functions are distributed among the `OR` conditions. I.e. every `OR` condition left operand will contain the regex functions. As those have to be executed for every `OR` condition, this quickly becomes slow. We can explicitely materialize the CTE to avoid that. This makes postgres evaluate the regex functions only once. But it will still have lots of `OR` conditions to check along with running pattern matching for each one of them. `LIKE(ANY(ARRAY[]))` avoids this issue. The CTE is still inlined but since we now only have a single condition, the regex functions are only evaluated once and pattern matched once against an array of options. This makes the whole query faster and scale better. #### speedup Customer database with 808341 sale.orders. Query timing when increasing the number of text tokens. | Number of tokens | Before PR | After PR | |:-------------------:|:----------:|:--------:| | 2 | 7s | 1.3s | | 5 | 10s | 1.3s | | 10 | 18s | 1.4s | | 20 | 33s | 1.55s | opw-4329067 opw-4316765 Forward-Port-Of: odoo/enterprise#74827 Forward-Port-Of: odoo/enterprise#73755
This commit fixes an issue with the social_linkedin module's comments fetch methods introduced in https://github.com/odoo/enterprise/pull/67079. This method disconnects the user from its account every time they open a post's comments, even if all API calls are successful. This shouldn't happen as nothing wrong happened to warrant a disconnection on our end. Now the user's account is disconnected if and only if there was an actual issue when fetching comments. task-4363737 Forward-Port-Of
Original PR description
This commit fixes an issue with the social_linkedin module's comments fetch methods introduced in https://github.com/odoo/enterprise/pull/67079. This method disconnects the user from its account every time they open a post's comments, even if all API calls are successful. This shouldn't happen as nothing wrong happened to warrant a disconnection on our end. Now the user's account is disconnected if and only if there was an actual issue when fetching comments. task-4363737 Forward-Port-Of: odoo/enterprise#74672