Daily updates from Odoo
Friday, November 22, 2024
25 changes
2 changes
Resolved issues and error corrections
Project users could encounter access errors when creating or updating tasks linked to billable projects if they did not have permission to view the related sales documents. This fix allows the system to retrieve the needed sales information in the background so task creation and updates work smoothly without expanding the user's sales access.
Original PR description
# First fix Steps to reproduce: ------------------- 1. Install Project and Sales apps 2. Log in as admin user (e.g. Mitchell Admin), and create a billable project for a customer A 3. Invite user B…
# First fix Steps to reproduce: ------------------- 1. Install Project and Sales apps 2. Log in as admin user (e.g. Mitchell Admin), and create a billable project for a customer A 3. Invite user B (e.g. Marc Demo) to the project 4. Only give project (user) access rights to the user B, remove all other access rights 5. Create an SO with customer A as partner, add a service product (e.g. Junior Architect), confirm the SO and create a timesheet 6. Log in as user B, create a task in the billable project from the task form, make sure customer A is set as partner 7. Save the task, an access error is raised Fix: ------------------- When creating a new task from the form, _inverse_partner_id() is called, which calls task._get_last_sol_of_customer(). As the user has no Sales access, the search of the SOL in _get_last_sol_of_customer() will raise an Access Error in such case. We add a sudo() before calling _get_last_sol_of_customer() to give the user access to the SOL we are looking for. # Second fix Steps to reproduce: ------------------- 1. Configure a user with the project > user and sales > user: own documents access rights 2. Log in with this user 3. Create a task in a billable project (e.g. for Deco Addict) 4. The compute automatically sets an SOL but the current user doesn't have access to the SOL (make sure that the user does not have access to the SOL that is set) 5. Error when trying to update the value of the SOL Fix: ------------------- We add a sudo() in _get_partner_display() to give the user access to the SO. As the user may not have access to the SO of the SOL that is currently set in the task. task-4207245 version-17.2 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update brings the spreadsheet component up to the latest version with fixes for collaboration, lookup formulas, data validation, and formula recalculation. Users should see fewer spreadsheet errors and more reliable behavior, especially when working with read-only sheets or complex formulas.
Original PR description
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/139e5a37f [REL] 17.2.27 Task: 0 https://github.com/odoo/o-spreadsheet/commit/807866cd0 [FIX] collaborative: don't…
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/139e5a37f [REL] 17.2.27 Task: 0 https://github.com/odoo/o-spreadsheet/commit/807866cd0 [FIX] collaborative: don't snapshot in read-only mode Task: 4344187 https://github.com/odoo/o-spreadsheet/commit/4347a9d46 [FIX] functions: Fix error message of some Lookup functions Task: 4320993 https://github.com/odoo/o-spreadsheet/commit/3961b21fc [FIX] functions: XLOOKUP linear search crashes without lookup values Task: 4320993 https://github.com/odoo/o-spreadsheet/commit/350728d92 [FIX] config: Update task url Task: 0 https://github.com/odoo/o-spreadsheet/commit/fd31d5f58 [FIX] Datavalidation: coreView plugin should not dispatch Task: 4241141 https://github.com/odoo/o-spreadsheet/commit/efdc06bbc [FIX] functions: remove MFILL from source Task: 0 https://github.com/odoo/o-spreadsheet/commit/45b5e0cbf [FIX] evaluation: log when reaching maximum iterations Task: 4252800 https://github.com/odoo/o-spreadsheet/commit/bb85e4430 [FIX] evaluation: Ensure dependency invalidation for array formulas Task: 4252800 Co-authored-by: Anthony Hendrickx (anhe) <anhe@odoo.com> Co-authored-by: Alexis Lacroix (laa) <laa@odoo.com> Co-authored-by: Lucas Lefèvre (lul) <lul@odoo.com> Co-authored-by: Dhrutik Patel (dhrp) <dhrp@odoo.com> Co-authored-by: Adrien Minne (adrm) <adrm@odoo.com> Co-authored-by: Mehdi Rachico (mera) <mera@odoo.com> Co-authored-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Pierre Rousseau (pro) <pro@odoo.com> Co-authored-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
5 changes
Enhancements to existing features
Bulk changes to helpdesk tickets and field service tasks now reuse sales order line lookups instead of repeating the same search for each record. This reduces processing time and database load when many records share the same customer or team, making large updates noticeably faster.
Original PR description
Steps to reproduce: ------------------- 1. Install Project, Timesheets, Helpdesk and Sales apps 2. Create many tickets (e.g. 5k) associated with the same helpdesk team 3. Change the project linked to…
Steps to reproduce:
-------------------
1. Install Project, Timesheets, Helpdesk and Sales apps
2. Create many tickets (e.g. 5k) associated with the same helpdesk team
3. Change the project linked to the helpdesk team
4. It should update the SOL of all tickets linked to that team
Other way to reproduce:
1. Install Project, Timesheets, Helpdesk and Sales apps
2. Create many tickets
3. Go to the list view of tickets
4. Update the customer in all those tickets
Fix:
-------------------
The idea is to batch the RPC (search) made by the method "_get_last_sol_of_customer()". Avoiding to do an RPC for each ticket, we can now re-use the computed SOLs as we store them in a dictionary. It particularly improve performance if we compute the sale_line_id of many tickets having similar commercial partners.
Benchmark:
-------------------
- Usecase: Create 5k tickets associated with an helpdesk team, change the project linked to the helpdesk team, it should update the SOL of all those tickets.
- Parameters: In local, run with "--limit-memory-soft=8589934592", "--limit-memory-hard=8589934592".
- Results:
Without optimization: 34 seconds, 30 665 queries
With optimization: 22 seconds, 15 397 queries
related-https://github.com/odoo/odoo/pull/185132
task-4255293Users can now duplicate approval requests directly from the form and list view menu. This makes it faster to create similar requests and reduces repetitive manual entry.
Original PR description
This PR improves the approval request form and list view by adding a `Duplicate` option to the menu. task-3685226
Users can now create and edit Brazil Avatax operation types in Odoo, matching custom setup options available in the Avatax portal. This helps businesses keep their Odoo tax configuration aligned with customer-specific Avatax settings.
Original PR description
We include the default ones Avatax has in their portal. But customers can create custom operation types on the Avatax side and so need to do similar on our side as well. task-4288101
Studio now includes an Actions tab where users can quickly view and create automated server actions for a model. Newly created actions are automatically added to the model's contextual menu, making common workflow automation easier to set up and use.
Original PR description
This commit adds a studio Tab to quickly access and create ir.actions.server objects. Upon creation, created actions are automatically added to the model's contextual menu. task-4268990
Resolved issues and error corrections
Recruitment report pivot tables now open the correct list of applicants when a user clicks a specific cell. This helps hiring teams review the relevant candidates faster and avoids confusion from seeing unrelated applicants.
Original PR description
The drill down, ie. clicking on a cell, in the recruitment report pivot views was not working as intended. When a cell was clicked it would show all applicants, rather than the relevant applicants to this cell. This PR fixes that, by making sure relevant data is fetched. Task-4247486
13 changes
Enhancements to existing features
Cashiers can now search for products in Point of Sale using their barcode, instead of only relying on product names or other details. This makes checkout faster and reduces confusion when barcode-based searches previously returned no results.
Original PR description
Before this commit, searching with the barcode of a product would not show any results. opw-4330143 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Restaurant point-of-sale orders now remain linked to their original table when tables are merged and later separated. This prevents lost or misplaced orders, making table management more reliable for restaurant staff.
Original PR description
Before this commit: =================== When merging tables, the order from the original table was transferred to the destination table, and the original table's order was deleted. As a result, when tables were unmerged, the original table's order could not be restored. After this commit: ================== When tables are merged and later unmerged, the original table's orders are successfully restored. This ensures that each table retains its initial order even after being merged and unmerged. Task- 4224207
Kitchen preparation cards now show all table numbers involved when restaurant tables are merged, instead of only the destination table. This helps kitchen staff identify orders more clearly and reduces confusion during service.
Original PR description
Before this commit: ================ When tables were merged in the restaurant, the kitchen display only showed the destination table number on the preparation card. After this commit: ================== Now, if tables are merged (e.g., Table 1 & Table 2), the kitchen display will show both table numbers (e.g., 1&2) on the preparation card. This provides better clarity for the kitchen staff by reflecting the merged table arrangement Task- 4224207 Related Community PR: https://github.com/odoo/odoo/pull/183070
Financial report actions that require the main company and all branches are now clickable and show a clear message when the right company selection is missing. This helps users understand what to do instead of assuming a disabled button is a system issue, reducing confusion and support requests.
Original PR description
When you have a company with branches in a database, some reports only make sense when you have the main company with all its branches selected. Currently some report actions (buttons) were disabled if you didn't have your main company and its branches selected, without any information on why the buttons were disabled. This resulted in people creating tickets because they thought something was wrong. This change makes the buttons clickable again, but instead displays a message saying that the user should select the main company and its branches in order to save a sensible report. [task-4260501](https://www.odoo.com/odoo/all-tasks/4260501)
Resolved issues and error corrections
Updates the spreadsheet component to the latest version with fixes for formula evaluation, copy/paste behavior, browser clipboard support, and collaboration in read-only mode. Users should see fewer crashes, clearer lookup errors, smoother spreadsheet editing, and small visual improvements to charts.
Original PR description
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/9eb34d905 [REL] 18.0.5 Task: 0 https://github.com/odoo/o-spreadsheet/commit/434c06097 [FIX] composer: overflow on…
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/9eb34d905 [REL] 18.0.5 Task: 0 https://github.com/odoo/o-spreadsheet/commit/434c06097 [FIX] composer: overflow on composer at end of screen Task: 4315958 https://github.com/odoo/o-spreadsheet/commit/e48b96bd2 [PERF] evaluation: early return errors Task: 4328215 https://github.com/odoo/o-spreadsheet/commit/70fe23b61 [FIX] conditional format: huge revisions on copy/paste cf Task: 4240668 https://github.com/odoo/o-spreadsheet/commit/ace25cfae [FIX] collaborative: don't snapshot in read-only mode Task: 4344187 https://github.com/odoo/o-spreadsheet/commit/23037c368 [FIX] clipboard: Fix clipboard cross-browser coverage Task: 4241877 https://github.com/odoo/o-spreadsheet/commit/65b519005 [FIX] functions: Fix error message of some Lookup functions Task: 4320993 https://github.com/odoo/o-spreadsheet/commit/b90326b0f [FIX] functions: XLOOKUP linear search crashes without lookup values Task: 4320993 https://github.com/odoo/o-spreadsheet/commit/d2e1e7ff9 [FIX] config: Update task url Task: 0 https://github.com/odoo/o-spreadsheet/commit/270308d61 [FIX] PivotDimension: Prevent DnD on dimension action buttons Task: 4095643 https://github.com/odoo/o-spreadsheet/commit/64a4cbc76 [FIX] Datavalidation: coreView plugin should not dispatch Task: 4241141 https://github.com/odoo/o-spreadsheet/commit/dab74e230 [FIX] evaluation: log when reaching maximum iterations Task: 4252800 https://github.com/odoo/o-spreadsheet/commit/07c48aa0d [FIX] evaluation: Ensure dependency invalidation for array formulas Task: 4252800 https://github.com/odoo/o-spreadsheet/commit/079a126ee [IMP] chart: improve bar chart borders Task: 4283212 Co-authored-by: Anthony Hendrickx (anhe) <anhe@odoo.com> Co-authored-by: Alexis Lacroix (laa) <laa@odoo.com> Co-authored-by: Lucas Lefèvre (lul) <lul@odoo.com> Co-authored-by: Dhrutik Patel (dhrp) <dhrp@odoo.com> Co-authored-by: Adrien Minne (adrm) <adrm@odoo.com> Co-authored-by: Mehdi Rachico (mera) <mera@odoo.com> Co-authored-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Pierre Rousseau (pro) <pro@odoo.com> Co-authored-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
This fixes how Odoo checks push notification permissions on iOS, especially for users running Odoo as a progressive web app. It prevents repeated or misleading permission prompts and helps users receive notifications only when their device can actually support them.
Original PR description
Follow-up of [1] and [2] iOS push notifications do not work on Safari: they only work in apps. The notifications are managed by the apps, whether with native mobile app or PWA. With PWA, it should…
Follow-up of [1] and [2] iOS push notifications do not work on Safari: they only work in apps. The notifications are managed by the apps, whether with native mobile app or PWA. With PWA, it should normally rely on `Notification.permission`, but somehow it doesn't work and always has value "default". Its showing has been limited to the PWA, but it keeps showing a persistent notification. Clicking on it the 1st time displays a prompt to either accept or deny the permissions. Afterwards, further clicks on the "odoobot has a request" automatically display "granted" or "denied" based on user initial choice. iOS push permissions seem to necessarily rely on `serviceWorker.getRegistration().pushManager`, which works only on HTTPS, hence why iOS push notifications do not work on HTTP. Also actual push permission state are correct there whereas on Notification.permission they are wrong. This commit fixes the issue by computing the push notification permisssion state correctly on iOS, using `serviceWorker.getRegistration().pushManager`. [1]: https://github.com/odoo/odoo/pull/178057 [2]: https://github.com/odoo/odoo/pull/187038
Users can now upload, create, or edit quote header and footer PDF files without triggering an error. This reduces disruption when configuring sales quote documents and makes PDF handling more tolerant of valid files that were previously rejected.
Original PR description
Currently a `PdfReadError` is arising when user try upload/create/edit the Headers/Footers from the menu. To get this error: - Go to "Headers/Footers" from the "Configuration" menu. - Click "New" or "Upload" to upload the PDF file. - For existing files, re-upload through "File Content(base64)". - The error appears in the console log. Sample File: [EA-20221231-13 (1).pdf](https://github.com/user-attachments/files/17813674/EA-20221231-13.1.pdf) Error: `PdfReadError: PDF starts with 'PK␃␄␔', but '%PDF-' expected` To fix this issue, set the parameter "strict" to "False" to be lenient in checking the file type while uploading/creating. sentry-6064981257
This fixes an inventory accounting issue when changing a product's category, especially for products with negative stock. It helps ensure valuation accounts and costing behavior are applied consistently, reducing the risk of incorrect stock accounting entries.
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
Merging accounting accounts now also updates related company default settings, preventing contacts from failing to create after a merge. This avoids broken references to removed accounts when multiple companies or localizations are involved.
Original PR description
**Steps to reproduce:** - Install accountant and contacts - Create a new company - Set a fiscal localization for that company (e.g. Belgium) - Select the 2 companies in the company selector - Go to…
**Steps to reproduce:** - Install accountant and contacts - Create a new company - Set a fiscal localization for that company (e.g. Belgium) - Select the 2 companies in the company selector - Go to "Accounting / Configuration / Accounting / Chart of Accounts" - Add "Receivable" filter - Select: * [121000] Account Receivable (from the main company) * [400000] Customers (from the Belgian company) - Merge the 2 accounts - Select the Belgian company in the company selector as main company - Try to create a contact **Issue:** A traceback is raised due to a missing account record. **Cause:** There is a "User-defined default" with "property_account_receivable_id" and "property_account_payable_id" fields of "res.partner" model that is created automatically for each company. As its value (i.e. account ID) is not updated when the accounts are merged, it is using an account ID that doesn't exist anymore. **Solution:** Check the "User-defined defaults" that are linked to an "account.account" field when merging accounts. opw-4269925 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix ensures Indian invoices and Point of Sale receipts show the correct reverse charge tax percentage in the HSN Summary. Customers now see the expected 18% rate instead of inflated percentages, improving document accuracy and compliance clarity.
Original PR description
Steps to re-produce in Invoicing app: 1. Create an customer invoice with `18% IGST RC` tax 2. Post the invoice 3. Print the PDF In the HSN Summary the expected tax percentage should be 18% but instead it displays 36% Steps to re-produce in Point Of Sale: follow the similar steps as above by creating a sale receipt in POS with `18% IGST RC` tax In the receipt HSN Summary the expected tax percentage should be 18% but instead it displays 72% By this commit we resolve the above mentioned issues --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The HTML editor now waits until a user focuses on it before starting collaboration services. This reduces unnecessary server load and helps improve performance when editor fields are present but not being used.
Original PR description
Issue:
The Editor connect to the collaboration BUS
directly when initialized, resulting in
performances struggle on the server.
Fix:
Restore the previous default behavior to wait for the
focus before initializing the BUS connection.
task-4348299
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis fixes a problem that prevented Mexican electronic invoice cancellations from working with the PAC SW provider after a recent certificate-related change. Businesses using PAC SW can cancel invoices normally again, reducing disruption in Mexican invoicing workflows.
Original PR description
Since https://github.com/odoo/enterprise/commit/84cc09959d82dbceb4fe673b85464ef3d8630606 the cancellation no longer works with the PAC SW opw-4349251
This fix restores the ability to remove tags in the Documents app without triggering an error. It ensures the tag deletion check uses the right data format, preventing a blocker for teams managing document organization.
Original PR description
**Issue:** Documents tags are impossible to remove. **Expected:** Documents tags removal allowed. **Steps to reproduce:** - Activate and navigate to the documents app; - Click on Configuration > Structure > Tags; - Attempting to delete a tag causes an error message. **Cause:** `external_ids` is a JSON object that can't be used in `search_count`, that method waiting for a list in that situation. **Fix:** Retrieve `external_ids` keys as a list. opw-4293294
5 changes
Resolved issues and error corrections
This update resolves an issue where the DIOT tax report was blank for customers using the 'Exento' tax type in Mexico. The fix removes a restriction in the data retrieval process, allowing the report to correctly display partner information for all transactions, regardless of tax type. This ensures accurate reporting for Mexican businesses.
Original PR description
### Steps to reproduce: - Install "l10n_mx" and switch to a Mexican company - Create a vendor bill with this partner using the tax "Exento" - Go to Reports -> Tax report -> DIOT.txt ### Cause: For partners that only have lines with the tax "Exento", no information are retrieved for the report. The columns "Type of third", "type of operation", "VAT", etc. are empty in the Tax report before trying to download the DIOT report. When trying to generate the txt file, the code tries to access the value "third_party_code" in a dictionary but the key is not there so an error is raised. This occurs because the tax "Exento" is "on_invoice" so there are no cash basis entry created. But in the custom query to retrieve the information of the partners it is specified the journal_id must be part of the cash basis journals. So no lines with "on_invoice" taxes were selected. ### Solution: Remove the journal restriction. opw-4312155
This update fixes a potential issue where deleting a parent folder could inadvertently delete associated Project folders due to a database constraint. The change ensures that all related folders are properly handled during deletion, preventing data loss and maintaining data integrity. This improves stability and reliability.
Original PR description
Steps to reproduce ------------------ 1. Change the parent of the "Projects" folder to put it in another folder. 2. Delete that folder. The "Projects" folder will be deleted, despite the constraint preventing it from being deleted. This is because when a relational field is set as `ondelete=cascade`, we don't call the `unlink` on the cascaded records and let the database handle it. Therefore, the constraint is not triggered. With this PR, we check not only the folder being deleted, but also its descendants. Task-4241631 Forward-Port-Of: odoo/enterprise#71468
This update resolves an issue preventing bookkeepers with the 'Bookkeeper' role in the Chilean localization module ('l10n_cl') from generating credit notes. The fix expands access rights to allow 'Billing' users to create the necessary invoice reference records, ensuring proper credit note functionality. This improves usability for Chilean businesses using the Odoo Enterprise system.
Original PR description
### Steps to reproduce: - Install "l10n_cl" and switch to a Chilian company - Give another user the role "Bookkeeper" - Switch to this user - Select an invoice and try to generate a Credit note - This user has not the right to create `l10n_cl.account.invoice.reference` ### Cause: The record `l10n_cl.account.invoice.reference` can only be created by managers (Accountant). ### Solution: Change the access rights to give full access on the record to users with the role "Billing". opw-4291981
This update resolves an issue where users could make advance payments for subscription products with a 'delivered quantity' invoice policy, even if the products hadn't been shipped. Now, advance payments are only allowed for partially delivered products, ensuring accurate payment processing and preventing overpayment.
Original PR description
Issue: In the subscription order user portal, the anticipate payment included products with the invoice policy set to delivered quantity that were not delivered yet. -Enable online payment and demo payment provider in the configuration. -Create a new subscription order in the subscription module. -Add a product with its invoice policy set to ordered quantity. -Add another product with its invoice policy set to delivered quantity. -Confirm the order and click on preview to access the user portal. -Proceed with the payment through the portal. It is now not possible to pay in advance through the user portal for recurring products with an invoice policy set to delivered quantity if they haven't been delivered yet. We still allow advance payments for partially delivered products. opw-3775930
This PR addresses a conflict that arises during an upgrade from version 16.0 to 17.0 of the l10n_es_reports module. The changes to report expressions introduced a UNIQUE constraint violation due to new engine types and subformulas. This update resolves the issue, ensuring a smooth upgrade process.
Original PR description
## 1st Issue **[FIX] l10n_es_reports: hanldle new expressions in mod349** In report line, if there is no related expression pointing at it, it is being created by shortcut syntaxes. Before this…
## 1st Issue
**[FIX] l10n_es_reports: hanldle new expressions in mod349**
In report line, if there is no related expression pointing at it,
it is being created by shortcut syntaxes.
Before this PR[^1], there were no expressions pointing at
these report lines:
1. mod_349_supplies
2. mod_349_acquisitions
3. mod_349_triangular
4. mod_349_services_sold
5. mod_349_services_acquired
6. mod_349_supplies_without_taxes
7. mod_349_supplies_without_taxes_legal_representative
8. mod_349_supplies_refunds
9. mod_349_acquisitions_refunds
10. mod_349_triangular_refunds
11. mod_349_services_sold_refunds
12. mod_349_services_acquired_refunds
13. mod_349_supplies_without_taxes_refunds
14. mod_349_supplies_without_taxes_legal_representative_refunds
After that PR, all of the report lines now include expressions with `engine=custom` and `label=balance`. For databases on version >= `16.0` before the PR, these report lines already have expressions without an IMD. However, during an upgrade, the addition of new expressions with an IMD triggers the creation of duplicates, resulting in a UNIQUE constraint violation on `(report_line_id, balance)`.
Steps to reproduce the issue:
1. Install `l10n_es_reports` in version `16.0` before that PR
2. Try to upgrade it to `17.0` after that PR
You will get error similar to this:
```
2024-10-30 13:56:05,428 3470006 WARNING test_l10n_es_report odoo.modules.loading: Transient module states were reset
2024-10-30 13:56:05,430 3470006 ERROR test_l10n_es_report odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/home/odoo/src/odoo/17.0/odoo/tools/convert.py", line 556, in _tag_root
f(rec)
File "/home/odoo/src/odoo/17.0/odoo/tools/convert.py", line 462, in _tag_record
self._tag_record(child_rec, extra_vals={inverse_name: record.id})
File "/home/odoo/src/odoo/17.0/odoo/tools/convert.py", line 462, in _tag_record
self._tag_record(child_rec, extra_vals={inverse_name: record.id})
File "/home/odoo/src/odoo/17.0/odoo/tools/convert.py", line 462, in _tag_record
self._tag_record(child_rec, extra_vals={inverse_name: record.id})
File "/home/odoo/src/odoo/17.0/odoo/tools/convert.py", line 456, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 5088, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4999, in _load_records_create
return self.create(values)
File "<decorator-gen-216>", line 2, in create
File "/home/odoo/src/odoo/17.0/odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "/home/odoo/src/odoo/17.0/addons/account/models/account_report.py", line 620, in create
result = super().create(vals_list)
File "<decorator-gen-123>", line 2, in create
File "/home/odoo/src/odoo/17.0/odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "/home/odoo/src/upgrade-util/src/util/orm.py", line 244, in wrapper
return f(*args, **kwargs)
File "/home/odoo/src/upgrade/migrations/base/0.0.0/pre-models-match_uniq.py", line 25, in create
return super().create(vals_list)
File "<decorator-gen-12>", line 2, in create
File "/home/odoo/src/odoo/17.0/odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4627, in create
records = self._create(data_list)
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4815, in _create
cr.execute(SQL(
File "/home/odoo/src/odoo/17.0/odoo/sql_db.py", line 332, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "account_report_expression_line_label_uniq"
DETAIL: Key (report_line_id, label)=(480, balance) already exists.
```
## 2nd Issue
**[FIX] l10n_es_reports: fix subformulas' of expressions in mod349**
In this PR[^1], the expressions `mod_349_statistics_invoices_total_amount_balance`
and `mod_349_statistics_refunds_total_amount_balance` was modified so the engine of
both of them changed from `domain` to `aggregation`. Also the subformula from both
of them were removed. But during the upgrade the engines are being modified but
the subformulas kept same.
Expected condition is having NULL on both of the expressions' subformula.
Because of they are not being changed during upgrade, they end up being `sum`
at the end.
When we try to open the `Tax report mod 349` after upgrade, the new engine and old
subformula are conflicting and facing issue here[^2].
Steps to reproduce
1. Install `l10n_es_reports` before the PR above in version `16.0`
2. Upgrade the db to `17.0` by solving the 1st issue of this PR
3. Try to open `Tax report mod 349`
you will see error like this:
```
.....
result = getattr(recs, name)(*args, **kwargs)
File "/home/odoo/src/enterprise/saas-17.4/account_reports/models/account_report.py", line 4869, in get_report_information
all_column_groups_expression_totals = self._compute_expression_totals_for_each_column_group(self.line_ids.expression_ids, options, warnings=warnings)
File "/home/odoo/src/enterprise/saas-17.4/account_reports/models/account_report.py", line 2826, in _compute_expression_totals_for_each_column_group
current_group_expression_totals = self._compute_expression_totals_for_single_column_group(
File "/home/odoo/src/enterprise/saas-17.4/account_reports/models/account_report.py", line 3011, in _compute_expression_totals_for_single_column_group
aggregation_formula_results = self._compute_totals_no_batch_aggregation(column_group_options, aggregation_formulas_dict, column_group_expression_totals, cross_report_expr_totals_by_scope)
File "/home/odoo/src/enterprise/saas-17.4/account_reports/models/account_report.py", line 3208, in _compute_totals_no_batch_aggregation
expression_result = self._aggregation_apply_bounds(column_group_options, expression.subformula, formula_result)
File "/home/odoo/src/enterprise/saas-17.4/account_reports/models/account_report.py", line 3266, in _aggregation_apply_bounds
group_values = match.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'
```
[^1]: https://github.com/odoo/enterprise/pull/65074
[^2]: https://github.com/odoo/enterprise/blob/3a7a46ff2404a5c4ca1c0ad676529fc17d9a2234/account_reports/models/account_report.py#L3455-L3461
Forward-Port-Of: odoo/enterprise#73082