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

[ADD] renamed-field-parameter: detect deprecated field values (digits_compute, select) (#91) #99

Conversation

tomeyro
Copy link
Contributor

@tomeyro tomeyro commented Dec 27, 2016

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

image

Copy link
Contributor

@lasley lasley left a 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):
Copy link
Contributor

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])
Copy link
Contributor

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'}

@tomeyro
Copy link
Contributor Author

tomeyro commented Dec 27, 2016

Thanks for the comments @lasley. Updated code as suggested.

@moylop260
Copy link
Collaborator

@JesusZapata
Could you fix conflicts please?

@JesusZapata
Copy link
Member

@moylop260
Done! I fixed the conflict!

@moylop260 moylop260 merged commit 51bd605 into OCA:master Jan 26, 2017
@moylop260 moylop260 deleted the master-merge-check-renamed-fields-vauxoo-tomeyro branch January 26, 2017 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants