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

xml_duplicate_fields: Support special case for 'Duplicate xml field "company_id"' #10

Closed
moylop260 opened this issue Oct 18, 2022 · 3 comments · Fixed by #32
Closed
Assignees
Labels
bug Something isn't working

Comments

@moylop260
Copy link
Collaborator

moylop260 commented Oct 18, 2022

I have checked the lint in odoo project itself and it is detecting the following cases:

odoo/addons/account/views/account_move_views.xml:166 Duplicate xml field "company_id" in lines 167
odoo/addons/account/views/account_account_views.xml:92 Duplicate xml field "company_id" in lines 104
odoo/addons/account/views/account_journal_views.xml:253 Duplicate xml field "company_id" in lines 257
odoo/addons/hr/views/hr_employee_views.xml:276 Duplicate xml field "company_id" in lines 281
odoo/addons/hr_holidays/views/hr_leave_stress_day_views.xml:32 Duplicate xml field "company_id" in lines 34
odoo/addons/hr_recruitment/views/hr_recruitment_views.xml:52 Duplicate xml field "company_id" in lines 53
odoo/addons/product/views/product_pricelist_item_views.xml:60 Duplicate xml field "company_id" in lines 85
odoo/addons/project/views/project_views.xml:691 Duplicate xml field "company_id" in lines 692
odoo/addons/project/views/project_views.xml:1509 Duplicate xml field "company_id" in lines 1510
odoo/addons/resource/views/resource_views.xml:61 Duplicate xml field "company_id" in lines 64
odoo/addons/stock/views/product_strategy_views.xml:8 Duplicate xml field "company_id" in lines 37
odoo/addons/stock/views/stock_quant_views.xml:111 Duplicate xml field "company_id" in lines 120
odoo/addons/stock/views/stock_quant_views.xml:363 Duplicate xml field "company_id" in lines 387
odoo/addons/stock/views/stock_orderpoint_views.xml:43 Duplicate xml field "company_id" in lines 62
odoo/addons/stock_picking_batch/views/stock_picking_batch_views.xml:63 Duplicate xml field "company_id" in lines 76

Also, check the following OCA case:

So, It could be a false red if there are invisible + known extra attributes e.g. groups

@pedrobaeza
Copy link
Member

pedrobaeza commented Oct 18, 2022

I don't think it's just company_id, but any field with groups, but also being part of a domain.

@moylop260
Copy link
Collaborator Author

@pedrobaeza

Good point!

Thank you!

In order to create the test_repo could you share me a whole xml with valid cases and another one similar but with invalid cases related to groups and ... "being part of a domain." part too, please?

Regards!

@pedrobaeza
Copy link
Member

What about just checking if there's more than one visible occurrence of the field? I think that can be the real reason of this linter. Although there's sometimes legit reasons to show the same field several times... Is this linter really helpful?

moylop260 added a commit to vauxoo-dev/odoo-pre-commit-hooks that referenced this issue Oct 24, 2022
moylop260 added a commit to vauxoo-dev/odoo-pre-commit-hooks that referenced this issue Oct 24, 2022
moylop260 added a commit that referenced this issue Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants