odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[FW][FIX] account: fix error when opening duplicated Profit and Loss reports

Open fw-bot opened this issue 5 months ago • 3 comments

Issue Duplicated Profit and Loss reports fail to open and raise an "invalid operation" error when accessed.

Steps to Reproduce

  1. Install the Accounting module and French localization.
  2. Go to Accounting > Configuration > Accounting > Accounting Reports.
  3. Duplicate the "Profit and Loss (2024)" report.
  4. Navigate to Accounting > Reporting > Profit and Loss.
  5. Attempt to open the duplicated report.
  6. An error occurs.

Root Cause During duplication, the label field of expressions is altered to include a " (copy)" suffix. Some formula expressions rely on exact label matches (e.g., i_1_2024.balance), so when "balance" becomes "balance (copy)", the lookup fails. This mismatch causes a KeyError when resolving subformulas like line_code.balance, breaking the report evaluation.

Fix Prevent the duplication process from altering the label of expressions. There is no functional need to add " (copy)" to these internal labels, as they are not user-facing and must remain stable for formula resolution to work.

Opw-4826749

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: odoo/odoo#212777

fw-bot avatar Jun 20 '25 17:06 fw-bot

Pull request status dashboard

robodoo avatar Jun 20 '25 17:06 robodoo

@csan-odoo @oco-odoo this PR targets master and is the last of the forward-port chain containing:

  • odoo/odoo#215277
  • odoo/odoo#215255

To merge the full chain, use

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

fw-bot avatar Jun 20 '25 17:06 fw-bot

@csan-odoo @oco-odoo ci/runbot failed on this forward-port PR

fw-bot avatar Jun 20 '25 18:06 fw-bot

@robodoo r+

oco-odoo avatar Jun 24 '25 09:06 oco-odoo

@oco-odoo you may want to rebuild or fix this PR as it has failed CI.

robodoo avatar Jun 24 '25 09:06 robodoo

Freeze happened while this was being merged to master ; manual forward-port for 18.4 is here https://github.com/odoo/odoo/pull/215600

oco-odoo avatar Jun 24 '25 13:06 oco-odoo