Wednesday, February 7, 2024
17 changes · master
Enhancements to existing features
Spreadsheet pivot autofill was adjusted to avoid unnecessary copying while preserving the original pivot setup. This should make the action more efficient and reduce the chance of unintended changes behind the scenes.
Original PR description
adaptation to avoid mutating the pivot definition See community PR
Resolved issues and error corrections
Fixed an issue where editing cells in account reports could trigger an error when debug mode was enabled. This helps accounting users and support teams work with editable reports more reliably during troubleshooting or configuration.
Original PR description
Editing an editable cell within account reports while in debug mode previously resulted in a traceback error. This issue was due to the strict props validation enabled in debug mode, where the `close` prop was being passed to the `AccountReportEditPopover` component without being defined in its list of accepted props. To address this, the `close` prop has now been duly added to the component's props list, ensuring smooth functionality and eliminating the error. task-3717423
Code cleanup and technical improvements
Spreadsheet missing-cell checks now run only when a user opens the dialog to insert a specific pivot cell, instead of during every spreadsheet evaluation. This reduces unnecessary processing, especially for dashboards or spreadsheets not being edited, while keeping the feature in the spreadsheet editing area where it belongs.
Original PR description
This commit moves the cell missing logic from the pivot model to spreadsheet edition. The objective is twofold: * It's not necessary to recompute the missing cells when the spreadsheet is not open in edition mode. (e.g. dashboard) * The missing cells feature is a feature of spreadsheet_edition, so it makes sense to move it to the spreadsheet_edition module. This commit also changes the way the missing cells are computed. The missing cells are now computed **only** when the user opens the spreadsheet dialog to insert a specific pivot cell. This is more efficient than recomputing the missing cells at each evaluation. Task: 3724263
Miscellaneous changes
This commit is a fix for the FontAwesomeIconSelector component. The regex being used didn't consider some added icons (using other font-family), or alterations of existing ones. Such selectors ".fa.fa-tiktok:before" were matching, resulting in icons being present from the list. But those icons cannot be used properly as a FontAwesome icon, since they may use another font-family, or alter the content value described from the scss. Now, only icons with selectors matching ".fa-[xxx]:before
Original PR description
This commit is a fix for the FontAwesomeIconSelector component. The regex being used didn't consider some added icons (using other font-family), or alterations of existing ones. Such selectors ".fa.fa-tiktok:before" were matching, resulting in icons being present from the list. But those icons cannot be used properly as a FontAwesome icon, since they may use another font-family, or alter the content value described from the scss. Now, only icons with selectors matching ".fa-[xxx]:before" are found, and the list no longer display invisible icons. Forward-Port-Of: odoo/enterprise#56034
For whatever reason, groupby didn't do its job. Anyway, it is more readable to groupby using a dict i/o itertools.groupby. task-3582248 Forward-Port-Of: odoo/enterprise#50159
Original PR description
For whatever reason, groupby didn't do its job. Anyway, it is more readable to groupby using a dict i/o itertools.groupby. task-3582248 Forward-Port-Of: odoo/enterprise#50159
It generates a lot of urls that will return 403 since it is restricted by country. Forward-Port-Of: odoo/enterprise#55928
Original PR description
It generates a lot of urls that will return 403 since it is restricted by country. Forward-Port-Of: odoo/enterprise#55928
### Steps to reproduce - Install **Payroll** app - Create two companies each belonging to different countries, for example: - Company A in US - Company B in AE - In **Company A**, create a salary structure with a salary rule that belong to Company A -US- - Using **Company A**, In the payroll app, Go to > **Reporting** > **Payroll** and click on the **MEASURES** dropdown button, U can see the newly created salary rule. Try clicking on it. Everything works fine. - Now switch to **Company
Original PR description
### Steps to reproduce - Install **Payroll** app - Create two companies each belonging to different countries, for example: - Company A in US - Company B in AE - In **Company A**, create a salary…
### Steps to reproduce - Install **Payroll** app - Create two companies each belonging to different countries, for example: - Company A in US - Company B in AE - In **Company A**, create a salary structure with a salary rule that belong to Company A -US- - Using **Company A**, In the payroll app, Go to > **Reporting** > **Payroll** and click on the **MEASURES** dropdown button, U can see the newly created salary rule. Try clicking on it. Everything works fine. - Now switch to **Company B**, create a salary structure with a salary rule that belong to **Company B** -AE- - Using **Company B**, In the payroll app, Go to > **Reporting** > **Payroll** and click on the MEASURES dropdown button, U can see the newly created salary rule. Try clicking on it. a DB error occurs. ### Investigation - When we create a new salary rule, we `_generate_payroll_report_fields()` https://github.com/odoo/enterprise/blob/b9adb690d7fd38c66a787377967a856b9678ffd1/hr_payroll/models/hr_salary_rule.py#L195 - Which `init()` the payroll report, creating a new DB view. However only the current company rules are fetched removing the other companies rules from the view as the old one is dropped https://github.com/odoo/enterprise/blob/b9adb690d7fd38c66a787377967a856b9678ffd1/hr_payroll/report/hr_payroll_report.py#L145 ### Discuss I think a better approach would be to construct a new view each time you open the payroll report, meaning to `init()` the report each time we go into https://github.com/odoo/enterprise/blob/b9adb690d7fd38c66a787377967a856b9678ffd1/hr_payroll/report/hr_payroll_report.py#L157-L165 but I think it's not a good idea to drop a view and create another each time also! opw-3675598 Forward-Port-Of: odoo/enterprise#55759 Forward-Port-Of: odoo/enterprise#55606
The cards in the ecological report weren't translated due to the strings being defined in t-values. This is switched so that they will now be correctly exported to the .pot file + translated. Additionally cleaned up some of the incorrect English for a better UX. More terms could be improved/fixed as well, but they do not affect the users as much + are already translated so changing them was avoided in stable. - Carbon => "carbon emissions": this or CO_2 are used when referring to re
Original PR description
The cards in the ecological report weren't translated due to the strings being defined in t-values. This is switched so that they will now be correctly exported to the .pot file + translated.…
The cards in the ecological report weren't translated due to the strings being defined in t-values. This is switched so that they will now be correctly exported to the .pot file + translated.
Additionally cleaned up some of the incorrect English for a better UX. More terms could be improved/fixed as well, but they do not affect the users as much + are already translated so changing them was avoided in stable.
- Carbon => "carbon emissions": this or CO_2 are used when referring
to reducing pollution due to burning fuel. "carbon" on its own implies
the element, whereas adding "emissions" to the end of it implies CO_2
(emissions), because English ¯\_(ツ)_/¯
- sparred => saved/reduced: sparred is both spelled wrong (i.e. should be spared) and incorrect to use in this case
- like => that's: "like" doesn't make sense to use in this case and is confusing to read. "That's" indicates how much the user is saving/reducing/etc. "Approximately" or "about" also would have worked, but are less friendly sounding
Forward-Port-Of: odoo/enterprise#55894
Forward-Port-Of: odoo/enterprise#54685Commit [1] moved (almost all of) the code of formatFloat from views/fields/formatters.js to core/utils/numbers, to make it accessible in the frontend. A formatFloat function was kept in formatters.js to handle the false case, which makes no sense in number utils, but is useful for fields. However, a lot of imports have been updated to use the numbers.js instead of formatters.js (i.e. they no longer benefit from the support of false), whereas they are actually formatting field values, so they sho
Original PR description
Commit [1] moved (almost all of) the code of formatFloat from views/fields/formatters.js to core/utils/numbers, to make it accessible in the frontend. A formatFloat function was kept in formatters.js to handle the false case, which makes no sense in number utils, but is useful for fields. However, a lot of imports have been updated to use the numbers.js instead of formatters.js (i.e. they no longer benefit from the support of false), whereas they are actually formatting field values, so they should have kept using the formatFloat from formatters.js This commit adapts the places where the formatFloat to use must come from formatters.js, not numbers.js. [1] https://github.com/odoo/odoo/commit/054ca0a19aaf297f420a1b478b93ae26f1b943b8 task 3722043 Forward-Port-Of: odoo/enterprise#55919
Steps to reproduce: ------------------- - install hr_payroll and hr_holidays; - create an employee; - create a contract for this employee (since 1st January for example); - create and approve a sick time off for this employee (for a day in January); - create a payslip for this employee (the payslip has two "worked days"); - confirm the payslip; - go to Reporting / Payroll and group by employee; - click on the employee's line to display the list view. Issue: ------ There are two rec
Original PR description
Steps to reproduce: ------------------- - install hr_payroll and hr_holidays; - create an employee; - create a contract for this employee (since 1st January for example); - create and approve a sick…
Steps to reproduce:
-------------------
- install hr_payroll and hr_holidays;
- create an employee;
- create a contract for this employee (since 1st January for example);
- create and approve a sick time off for this employee (for a day in January);
- create a payslip for this employee (the payslip has two "worked days");
- confirm the payslip;
- go to Reporting / Payroll and group by employee;
- click on the employee's line to display the list view.
Issue:
------
There are two records.
This can be explained by saying that this is a record by worked days type. However, if we click on it, we see that the detail is the same for both records.
Cause:
------
The query which generates the virtual table `hr_payroll_report` will give as `id`, the value of the `id` which corresponds to the payslip.
```sql
SELECT
p.id as id,
wd.id as wdid,
wd.name
FROM
(SELECT * FROM hr_payslip WHERE state IN ('done', 'paid')) p
left join hr_payslip_worked_days wd on (wd.payslip_id = p.id)
```
The result of this query will be two records:
```
id | wdid | name
----+------+------------
1 | 2 | Unpaid
1 | 3 | Attendance
```
When we want to obtain the details of the record, we will perform a read on the `hr.payroll.report` model for an `id` equal to 1 for both records, i.e. we will retrieve the same values.
Solution:
---------
Forcing the id to be unique.
Add a field indicating the type to avoid confusion.
Note:
In the list view, it is possible to group by "Payslip Name" to avoid confusion.
Note 2:
It is a band-aid fix that helps us understand what is going on in the report, but it needs to be redesigned to redirect us directly to payslip records and not records corresponding to worked days (and avoid aggregation problems).
opw-3686692
Forward-Port-Of: odoo/enterprise#55882
Forward-Port-Of: odoo/enterprise#55629Before this commit: - The `documents_tour` progresses as desired but is stuck during the final few steps. - The `documents_account_tour` has the same issue but additionally has a misplaced prompt to select the first image `mail.png` having the `inbox` tag. - The `o_FileViewer` class is incorrect. Issue: - The classes inside the trigger are missing/incorrect. - After we process the initial set of pages, the prompt to select the last remaining page is missing. After this commit: - Rect
Original PR description
Before this commit: - The `documents_tour` progresses as desired but is stuck during the final few steps. - The `documents_account_tour` has the same issue but additionally has a misplaced prompt to select the first image `mail.png` having the `inbox` tag. - The `o_FileViewer` class is incorrect. Issue: - The classes inside the trigger are missing/incorrect. - After we process the initial set of pages, the prompt to select the last remaining page is missing. After this commit: - Rectified the classes and added an extra step to select the remaining page and then process the tour. - Updated the `o_FileViewer` to `o-FileViewer`. task-3537521 Forward-Port-Of: odoo/enterprise#54935 Forward-Port-Of: odoo/enterprise#49027
On the tax report, a banner can be displayed if there exist some draft moves for the selected period. We don't want the banner to appear if the only draft move is a closing entry. The goal of the banner is indeed to warn the user if he still needs to pay attention to draft invoices/entries that might impact the report. We therefore exclude all closing entries from draft moves search. A bit of refactoring was necessary to only apply the logic to tax reports. A limit=1 has also been added on the s
Original PR description
On the tax report, a banner can be displayed if there exist some draft moves for the selected period. We don't want the banner to appear if the only draft move is a closing entry. The goal of the banner is indeed to warn the user if he still needs to pay attention to draft invoices/entries that might impact the report. We therefore exclude all closing entries from draft moves search. A bit of refactoring was necessary to only apply the logic to tax reports. A limit=1 has also been added on the search_count to improve performances. task-3682431 Forward-Port-Of: odoo/enterprise#55573 Forward-Port-Of: odoo/enterprise#55167
As seen in the nightly build https://runbot.odoo.com/runbot/build/57728091 There is an issue with the demo data where a hr employee record is trying to be set in a res.partner field. Also, one test is setting accounting stuff while this module isn't dependent on any account modules. Forward-Port-Of: odoo/enterprise#55932
Original PR description
As seen in the nightly build https://runbot.odoo.com/runbot/build/57728091 There is an issue with the demo data where a hr employee record is trying to be set in a res.partner field. Also, one test is setting accounting stuff while this module isn't dependent on any account modules. Forward-Port-Of: odoo/enterprise#55932
During the last phase of the refactor in 17.1, the field names were updated but the neutralize script was not, making it inconsistent. Forward-Port-Of: odoo/enterprise#55921
Original PR description
During the last phase of the refactor in 17.1, the field names were updated but the neutralize script was not, making it inconsistent. Forward-Port-Of: odoo/enterprise#55921
Steps to reproduce: - Install Accounting and l10n_mx_edi - Switch to a Mexican company (e.g. ESCUELA KEMPER URGATE) - Create an invoice: * Customer: [any] (e.g. INMOBILIARIA CVA) * Product: [any product with an UNSPSC Category] - Confirm the invoice - Generate CFDI via "Send & Print" button - Register Payment (Payment Way: Effectivo) - Click on "Update Payments" button - Go to the payment - Force CFDI - Send receipt by email Issue: The CFDI document of the payment is not in t
Original PR description
Steps to reproduce: - Install Accounting and l10n_mx_edi - Switch to a Mexican company (e.g. ESCUELA KEMPER URGATE) - Create an invoice: * Customer: [any] (e.g. INMOBILIARIA CVA) * Product: [any product with an UNSPSC Category] - Confirm the invoice - Generate CFDI via "Send & Print" button - Register Payment (Payment Way: Effectivo) - Click on "Update Payments" button - Go to the payment - Force CFDI - Send receipt by email Issue: The CFDI document of the payment is not in the attachments of the email as it was in previous versions. Cause: The feature was lost during the refactoring of "l10n_mx_edi" module to not depend on "account_edi" module opw-3678484 Forward-Port-Of: odoo/enterprise#55016
Steps to reproduce: - Select any transfer in barcode App - Click add product to manually edit quantity - Set quantity to 0.0002 - Click on -1 multiple times then +1 Bug: the quantity is displayed with too many precision digits (defaul float) Fix: The addition and subtraction with the +1 / -1 button should be upto the decimal value entered. opw-3551250 Forward-Port-Of: odoo/enterprise#55786 Forward-Port-Of: odoo/enterprise#53378
Original PR description
Steps to reproduce: - Select any transfer in barcode App - Click add product to manually edit quantity - Set quantity to 0.0002 - Click on -1 multiple times then +1 Bug: the quantity is displayed with too many precision digits (defaul float) Fix: The addition and subtraction with the +1 / -1 button should be upto the decimal value entered. opw-3551250 Forward-Port-Of: odoo/enterprise#55786 Forward-Port-Of: odoo/enterprise#53378
This traceback arises when a user tries to unlink multiple records Steps to produce 1. Install `approvals` 2. Open `approvals/manager/all approvals` 3. Select multiple records then delete them. Error: ``` ValueError: too many values to unpack (expected 1) File "odoo/models.py", line 5837, in ensure_one _id, = self._ids ValueError: Expected singleton: approval.request(9, 8) File "odoo/http.py", line 2150, in __call__ response = request._serve_db() File "odoo/ht
Original PR description
This traceback arises when a user tries to unlink multiple records Steps to produce 1. Install `approvals` 2. Open `approvals/manager/all approvals` 3. Select multiple records then delete them.…
This traceback arises when a user tries to unlink multiple records
Steps to produce
1. Install `approvals`
2. Open `approvals/manager/all approvals`
3. Select multiple records then delete them.
Error:
```
ValueError: too many values to unpack (expected 1)
File "odoo/models.py", line 5837, in ensure_one
_id, = self._ids
ValueError: Expected singleton: approval.request(9, 8)
File "odoo/http.py", line 2150, in __call__
response = request._serve_db()
File "odoo/http.py", line 1722, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1749, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1953, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 222, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 722, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 24, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 20, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 468, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "home/odoo/src/enterprise/17.0/approvals/models/approval_request.py", line 113, in unlink
if self.has_product:
File "odoo/fields.py", line 1148, in __get__
record.ensure_one()
File "odoo/models.py", line 5840, in ensure_one
```
When the user tries to delete multiple records traceback will be generated because it tries to unlink a record instead of calling the entire record set.
which leads to the traceback from here
https://github.com/odoo/enterprise/blob/1551fc9de63706944dffb3d5e57c88482b214a46/approvals/models/approval_request.py#L96-L105
After applying this commit we will resolve the issue by filtering the records and then unlinking the record set.
sentry-4916651369
Forward-Port-Of: odoo/enterprise#55848
Forward-Port-Of: odoo/enterprise#55412