-
Notifications
You must be signed in to change notification settings - Fork 74
[IMP] util/fields: Convert to company dependent without company field #313
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
[IMP] util/fields: Convert to company dependent without company field #313
Conversation
upgradeci retry with always only base |
Can you add a test? |
0dc8bd3
to
f131338
Compare
f131338
to
c1698c8
Compare
I rebased and pushed a fixup for the test to avoid reading the whole JSON data back |
956d79b
to
5a0bd07
Compare
src/base/tests/test_util.py
Outdated
# make the ORM re-read the info about these manual fields from the DB | ||
self.registry._setup_models__(self.env.cr, ["res.partner"]) |
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.
With the help of @HydrionBurst this was the missing part to make the ORM reload the manual fields with the right metadata.
5a0bd07
to
85be83a
Compare
src/base/tests/test_util.py
Outdated
|
||
# make the ORM re-read the info about these manual fields from the DB | ||
if hasattr(self.registry, "_setup_models__"): | ||
self.registry._setup_models__(self.env.cr) |
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.
self.registry._setup_models__(self.env.cr) | |
args = (["res.partner"],) if util.version_gte("saas~18.4") else () | |
self.registry._setup_models__(self.env.cr, *args) |
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.
Done, a variant of this...
The current implementation of the function `_convert_field_to_company_dependent` requires a field that stores the company value, but this field is not always available. This change aims to allow that case by passing a falsy value as company_field, then it creates a json with the current value for all companies as the new value in the column
85be83a
to
8372b21
Compare
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+
The current implementation of the function
_convert_field_to_company_dependent
requires a field that stores the company value, but this field is not always available.This change aims to allow that case by passing a falsy value as company_field, then it creates a json with the current value for all companies as the new value in the column