Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] base: edit any reports in the studio mode #162007

Draft
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

mega-odoo
Copy link
Contributor

@mega-odoo mega-odoo commented Apr 16, 2024

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]:

module, view_id = xmlid.split('.')

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

@robodoo
Copy link
Contributor

robodoo commented Apr 16, 2024

@C3POdoo C3POdoo added the RD research & development, internal work label Apr 16, 2024
Currently, raise a 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:  https://github.com/odoo/odoo/blob/1648ee1abff1ae12b3933baa85a2e048fa2eb557/odoo/addons/base/models/ir_ui_view.py#L102

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.
@mega-odoo mega-odoo force-pushed the 17.0-sentry-5128667236-web-studio-report-edit-mega branch from c1b2b6d to 3148cd0 Compare April 17, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants