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

[15.0][OU-FIX] don't fail when there's an unknown field in a view #4271

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

hbrunn
Copy link
Member

@hbrunn hbrunn commented Dec 22, 2023

given we don't raise in raise_view_error, we get an unbound local error after https://github.com/OCA/OCB/blob/15.0/odoo/addons/base/models/ir_ui_view.py#L1838 if a field used in a view doesn't exist. Seems fine to me to just ignore this then. If you agree I'll cherry pick to v16

@hbrunn hbrunn added this to the 15.0 milestone Dec 22, 2023
@OCA-git-bot
Copy link
Contributor

Hi @StefanRijnhart, @legalsylvain,
some modules you are maintaining are being modified, check this out!

@hbrunn hbrunn changed the title [15.0][FIX] don't fail when there's an unknown field in a view [15.0][OU-FIX] don't fail when there's an unknown field in a view Dec 22, 2023
@hbrunn hbrunn force-pushed the 15.0-unknown-fields-in-view branch from cb6b461 to eb96dd8 Compare December 22, 2023 18:10
Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure to understand : on which variable there is an UnboundLocalError error ?

@hbrunn
Copy link
Member Author

hbrunn commented Dec 22, 2023

in the line just below my link, it accesses field, but field hasn't been bound because the assignment failed with a key error. Without our patched _raise_view_error we'd never get there because the original raises

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the explanation.

Makes sense.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never faced this one, but it's OK from a technical PoV.

@pedrobaeza pedrobaeza merged commit d58dcf5 into OCA:15.0 Dec 22, 2023
@hbrunn
Copy link
Member Author

hbrunn commented Dec 22, 2023

thanks, here the same for v16: #4272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants