-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[12.0][MIG] server environment ir config parameter #1378
[12.0][MIG] server environment ir config parameter #1378
Conversation
… values This is much more robust that raising an error, and let modules load ir.config_parameter from xml data files, while still enforcing values from the config files.
Odoo loads modules that contain static directory, so it wanted to load server_environment_files but it does not exist
Without this sudo get_param would fail when the first user reading a parameter that has changed in the configuration file does not have write access to system parameters.
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.
Just minor changes but seems good (about code)
|
||
@api.model | ||
def get_param(self, key, default=False): | ||
value = super(IrConfigParameter, self).get_param(key, default=None) |
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.
In Python 3 you can let the super() empty:
value = super().get_param(key, default=None)
It's certainly not an issue (about Python) but it's not necessary.
if serv_config.has_option(SECTION, key): | ||
# enforce value from config file | ||
vals = dict(vals, value=serv_config.get(SECTION, key)) | ||
return super(IrConfigParameter, self).create(vals) |
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.
Same here (about the super()
)
newvals = dict(vals, value=serv_config.get(SECTION, key)) | ||
else: | ||
newvals = vals | ||
super(IrConfigParameter, rec).write(newvals) |
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.
But here you have to keep it because you use rec
and not self
.
class TestEnv(common.TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestEnv, self).setUp() |
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.
Same comment here (about super()
)
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.
Fix the super() and it's ok
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.
This should go to OCA/server-env
#1368