-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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: add more information if wrong related field #31889
Conversation
Should make debugging easier in some cases. +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nim-odoo can you r+?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robodoo r+
@robodoo r- @xmo-odoo are you still opposed to making merge-bot more responsible for whatever it's merging? ;-) |
Mostly yeah, it's not really its point or goal. I still think it would make more sense to have separate status check / checkers for constraints we want to put on commit or PR messages (and others e.g. we might eventually want to add JS linters and whatnot). |
@fmdl Could you please make sure to write correct commit messages? As far as I can remember, I always had to rewrite your commit message for all your PRs I merged. Most of the time, it was a simple copy-paste of the PR title/description since these are fine. Thanks. |
@nim-odoo for the future I will try to make a better commit message. |
ping @nim-odoo |
cc @mart-e |
ping @xmo-odoo |
The comment raised by @odony is still not resolved (although you marked it as such without any explanation), other than that I'm not opposed to merging this into master |
@Elkasitu updated |
Before this commit, if a related field's path definition contained a non-existing field (either because of a typo or field removal) the ORM would simply send a generic Python KeyError that didn't really help in debugging. With this commit, we raise our own KeyError stating which related field has the wrong path definition and exactly which field within the path is incorrect. See test for an example.
@robodoo r+ |
Before this commit, if a related field's path definition contained a non-existing field (either because of a typo or field removal) the ORM would simply send a generic Python KeyError that didn't really help in debugging. With this commit, we raise our own KeyError stating which related field has the wrong path definition and exactly which field within the path is incorrect. See test for an example. closes #31889 Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
Description of the issue/feature this PR addresses:
During a migration process if a field have change/removed, during the installation there is a KeyError on related field.
Before :
KeyError: "purchase_line_id"
After
KeyError: "Wrong related field, 'stock.move.purchase_order_id', relation : 'purchase_line_id.order_id', wrong field : 'purchase_line_id'"
@odony @nim-odoo
cc @sla-subteno-it
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr