-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
[ADD] renamed-field-parameter: detect deprecated field values (digits_compute, select) (#91) #99
[ADD] renamed-field-parameter: detect deprecated field values (digits_compute, select) (#91) #99
Conversation
…_compute, select) (Vauxoo#91)
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.
Thanks @tomeyro - few comments, but otherwise good
@@ -324,6 +369,15 @@ def visit_call(self, node): | |||
'_' + argument.arg + '_'): | |||
self.add_message('method-' + argument.arg, | |||
node=argument_aux) | |||
elif (argument.arg in | |||
self.config.deprecated_field_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.
Non blocking, but you could remove a few lines by using an intermediary variable:
deprecated = self.config.deprecated_field_parameters
>>> self.colon_list_to_dict(['colon:list', 'empty_key:']) | ||
{'colon': 'list', 'empty_key': ''} | ||
""" | ||
return dict([item.split(":") for item in colon_list]) |
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.
No need to create a list:
>>> dict(item.split(':') for item in colon_list)
{'key2': 'val2', 'key1': 'val1'}
Thanks for the comments @lasley. Updated code as suggested. |
@JesusZapata |
@moylop260 |
Add check to detect deprecated/renamed parameters in a field constructor.
Checking the parameters specified in: https://github.com/odoo/odoo/blob/10.0/odoo/fields.py#L29