-
Notifications
You must be signed in to change notification settings - Fork 4
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] pylint-odoo: Fix to calculate name of field, referrring to OCA/pylint-odoo#108 #108
[FIX] pylint-odoo: Fix to calculate name of field, referrring to OCA/pylint-odoo#108 #108
Conversation
@@ -390,6 +390,12 @@ def colon_list_to_dict(self, colon_list): | |||
""" | |||
return dict([item.split(":") for item in colon_list]) | |||
|
|||
def _convert_value_to_name(self, attribute): | |||
"""Convert 'Field Case SENSITIVE' to 'field_case_sENSITIVE' """ | |||
parts = [(part[0].lower() + part[1:]) for part in attribute.split(' ')] |
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.
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.
Must be converted from 'Field Case SENSITIVE' to 'field_case_sENSITIVE'
Is not there a function for that?
Already the word comes in capitalize!
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.
You need emit the message just for the following cases:
# E.g. of odoo field: field_name = fields.Type(string='field string')
field_name = field_name.replace('_', ' ')
if field_string in [field_name.capitalize(), field_name.title()]:
self.add_message(...)
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.
@moylop260
I have refactored the code!
Thanks!
f3d6dcc
to
7804514
Compare
7804514
to
799d637
Compare
Could you run this new change from addons-vauxoo project, please? |
@moylop260
************* Module addons-vauxoo.default_warehouse_from_sale_team.models.sales_team
W: 10,24: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.stock_quant_cost_segmentation.model.stock
W:114,20: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:117,22: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:120,26: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:123,18: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.stock_quant_cost_segmentation.model.product
W: 28,20: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 30,22: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 32,26: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 34,18: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.partner_credit_limit.model.partner
W: 15,24: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.stock_card.model.stock_card
W:418,21: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:422,26: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:426,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:434,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.account_voucher_tax_sat.model.account_voucher_tax_sat
W: 37,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.product_do_merge.model.product
W: 31,18: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.product_do_merge.wizard.base_product_merge
W: 61,12: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 72,19: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 74,17: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.purchase_changeless_move_lines.model.purchase
W: 33,21: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.purchase_changeless_move_lines.model.stock_picking
W: 33,21: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.stock_picking_invoice_validation.model.stock_transfer_details
W: 25,24: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.sale_block_cancellation.models.sale
W: 63,19: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.aging_due_report.wizard.wizard
W: 56,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 57,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 58,10: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 59,12: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 60,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 61,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:139,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:152,12: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:154,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:157,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:160,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:220,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:223,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:248,20: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:262,11: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W:290,16: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.hr_timesheet_reports.model.hr_timesheet_reports
W:358,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.test_sale_team_warehouse.models.test_model
W: 17,16: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 32,16: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.payment_term_type.models.payment_term
W: 35,19: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.website_product_availability.models.product
W: 77,16: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.purchase_incoming_qty.model.product
W: 34,28: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 57,28: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.partner_foreign.model.res_partner
W: 91,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.website_rate_product.models.mail_message
W: 30,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
W: 66,13: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.purchase_order_line_sequence.model.purchase
W: 54,15: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant)
************* Module addons-vauxoo.account_refund_early_payment.wizard.refund_early_payments
W: 76,14: The attribute string is redundant. String parameter equal to name of variable (attribute-string-redundant) |
@@ -411,11 +411,13 @@ def visit_call(self, node): | |||
for argument in args: | |||
argument_aux = argument | |||
# Check this 'name = fields.Char("name")' | |||
field_name = \ |
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.
Avoid use backslash better use (
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.
@moylop260
Done!
Fix for OCA please |
@moylop260 |
Referring to OCA#108