Daily updates from Odoo
Friday, November 22, 2024
17 changes · 17.0
Enhancements to existing features
This update provides Romania with the option to generate a 4 or 5-column trial balance report, aligning with their local accounting standards. The underlying trial balance implementation has been improved for easier customization and future updates. This ensures accurate reporting for Romanian businesses using Odoo Enterprise.
Original PR description
Romania does not use the 3-column trial balance report, instead they use a 4-column and 5-column variant. This commit adds the 4/5-column report as variants to the standard trial balance. The standard trial balance implementation has been changed to be easier to override and add column groups. task: 3810685
This update adds a new XML export button to the German Intrastat report. This allows businesses to easily generate the required XML files for submitting their Intrastat reports to German authorities, streamlining the reporting process and ensuring compliance. The change is part of ongoing improvements to our German localization features.
Original PR description
This commit add the export to xml button on the intrastat report for Germany. More information can be found here: - https://erhebungsportal.estatistik.de/Erhebungsportal/informationen/hilfe-zur-meldungsabgabe-3749 task-4194404 Forward-Port-Of: odoo/enterprise#71785
This update introduces a new system parameter in the accounting settings, allowing users to specify a custom VAT number instead of the default accounting firm's VAT for CodaBox connections. This flexibility addresses situations where accounting firms require a different VAT to be used as their contract number, improving the connection's accuracy and usability.
Original PR description
Currently, the accounting firm's VAT is used for the CodaBox connection but sometimes, accounting firms need to use a different VAT as their contract number. This adds a system parameter that if filled, is used instead of the firm's VAT. task-4335294
This update ensures that the names of invoice reports generated by the l10n_mx_edi module now align with the corresponding XML invoice data. This improves data consistency and simplifies reporting processes for Mexican businesses using Odoo Enterprise. It addresses a user request for a more straightforward reporting experience.
Original PR description
Users require the name of the invoice report to be the same as the xml. task-4284482
Resolved issues and error corrections
This update resolves a confusion reported by some clients regarding shift copying after using the 'copy previous week' feature. Previously, if a project linked to a shift had zero allocated hours, the shift wouldn't copy. Now, the system allows the shift to be copied even with zero allocated hours to eliminate this confusion.
Original PR description
Some clients were confused about not knowing why their shifts were not copied after setting a project to them (using the copy previous week feature). The reason was that the project linked to their shifts had allocated hours equal to 0. After this commit, if 0 hours are allocated to the project, we allow to copy the shift anyway to avoid confusion (as some clients are clearly not using this field). task-4074736 version-17.0
This update addresses small technical issues within the FedEx delivery integration module. Specifically, it improves security by replacing a potentially unsafe coding practice and enhances translation support by adding a base translation file. These changes ensure smoother and more reliable operation of the FedEx delivery process.
Original PR description
- Add .pot base translation file. - Replace potentially unsafe `const_eval()` with a `json.loads()`. - Use the built-in methods for setting filename for received files.
This update resolves an issue where the Gantt chart was displaying outdated attendance records due to a miscalculation of date ranges. The fix ensures that records with missing end dates are excluded from the chart's view, preventing inaccurate data and improving chart performance. This update addresses a technical error that could impact the accuracy of attendance reporting.
Original PR description
Steps to reproduce ================== - Install hr_attendance_gantt,web_studio - Go to Attendences - Open studio - Enable "Display total row" in the sidebar - Exit studio - Create a new entry with no end date - Switch to the week view - Go to the previous week => `Cannot read properties of undefined (reading 'pills')` Cause of the issue ================== When records don't have a dateStop value, it is set as now(). The domain included record that start before now and have no stop (so converted to now). If the current window is between the 01 and 07 Nov, and today is 14 Nov, a record starting the 09 Nov that has no end date will be included. When finding the closest date, it will be out of bound (day 8 when we only have 7). Solution ======== Those records shouldn't be included at all as the are outside the current viewable range. opw-4160977
A recent update to the Swiss payroll localization module introduced a change that impacted a key test. This fix adjusts a test to accurately reflect the new module and its functionality, ensuring continued reliability of the Swiss payroll calculations. The change is a minor technical adjustment to improve test coverage.
Original PR description
[link to broken tests](https://runbot.odoo.com/web#id=68972&menu_id=424&cids=1&action=573&model=runbot.build.error&view_type=form) since [this pr](https://github.com/odoo/enterprise/pull/62136), a lot of things changed in swiss payroll localization. One of the changes was introduction of new module, l10n_ch_hr_payroll_elm. This affected one of the assertQueryCount tests checking compute_sheet function, which is also overwriten in said module. Therefore, we need to increase the query count accordingly. Flamegraph of function _get_base_local_dict before above mentioned pr:  Flamegraph of same function after the pr: 
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 resolves an issue where commission calculations were failing when some invoices had incomplete start and end dates for subscriptions. The fix ensures that the system only considers valid dates for maximum and minimum calculations, preventing errors and ensuring accurate commission generation.
Original PR description
Following 81dce8461c7, when only some of the invoice lines have subscription start/end date, the commission generation crash when computing the maximum end date or minimal start start: ``` TypeError: '>' not supported between instances of 'bool' and 'datetime.date' ``` This commit ensure we only try to max/min non-falsy values. Forward-Port-Of: odoo/enterprise#74112
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 update fixes an issue where Spanish translations for the l10n_co_reports module were accidentally deleted during a cleanup process. The translations have been restored, synced, and corrected, including a previously inaccurate sentence. This ensures accurate reporting in Spanish.
Original PR description
During the es_XX.po cleaning, the po file for l10n_co_reports was incorrectly not converted to es_419.po and only deleted. We now restore it + correctly rename it to es_419.po As part of this cleaning, the pot file has been re-exported and the po re-synced with it. Missing translations were also added it. A sentence that was obviously incorrect in the original Spanish was also translated to a correct sentence. opw-4336377 PR that deleted the original es_CO.po file: https://github.com/odoo/enterprise/pull/66317
This update resolves a technical issue within Odoo's Studio interface that prevented users from correctly configuring Sales Team settings. Specifically, the Studio was unable to recognize a key filter used in the Sales Team's configuration, leading to an error. This fix ensures Sales Team settings can be accurately adjusted through the Studio.
Original PR description
Steps to reproduce ================== - Install crm,web_studio - Enable leads - Go to CRM > Configuration > Sales Team - Open the first record - Uncheck Pipeline and Leads - Go to CRM > Sales > Teams - Open studio => Undefined graph model for Sales Team: Pre-Sales Cause of the issue ================== The window action uses the following domain `[["use_opportunities", "=", true]]` It is not used from within studio. opw-4285413
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#73082This update addresses a visual glitch in the timesheet grid view where columns would flicker during scrolling. The fix adjusts the first column's width to a fixed percentage, ensuring a smoother and more stable display of data. This improves the user experience when viewing large amounts of timesheet information.
Original PR description
Steps to reproduce: ------------------------------ - Install the timesheet module. - Open the module - Open all timesheets in grid view - Scroll the page - There is a flicker when scrolling Issue: -------------- When scrolling in grid view, there is a flicker in columns. Cause: ----------- The grid-template-columns property the first column is set to auto, meaning its width is determined by its content. However, as the content dynamically changes, such as during scrolling, the column width adjusts causing flickering.This occurs because the content size affects the column width. Solution : ----------------- The grid-template-columns property sets the width of the first column in the grid layout to 30% of the screen task-3743360