[FIX] base: edit any reports in the studio mode #162007
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, raise an error message in the report editor when trying to edit any reports in the studio mode.
error message: too many values to unpack (expected 2))
When we modify a report, the system tries to make a copy of it. To make this copy, the system needs to provide certain details like the name, mode key etc . At that time system tries to assign multiple values instead of two at this point [1] because the 'key' passed to do a copy of the report is [2] split by '.' as we see in [1] which leads to multiple values instead of two.
link [1]:
odoo/odoo/addons/base/models/ir_ui_view.py
Line 102 in 1648ee1
link [2]:
https://github.com/odoo/enterprise/blob/34a042bb196273c34cd163f4c43bbd858664b7dc/web_studio/controllers/report.py#L337
To resolve the issue, Add limiting into split, To ensure that there are only two elements in the resulting list, which can unpacked into two (first is module, second is view_id) variables to prevent error.
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr