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

[REF] checks_odoo_module_xml: Allow duplicated fields with 'groups' #32

Merged
merged 2 commits into from Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -274,7 +274,7 @@ options:
* xml-duplicate-fields

- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.11/test_repo/broken_module/model_view_odoo2.xml#L132 Duplicate xml field "name" in lines 133
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.11/test_repo/broken_module/model_view_odoo2.xml#L138 Duplicate xml field "name" in lines 139
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.11/test_repo/broken_module/model_view_odoo2.xml#L141 Duplicate xml field "name" in lines 142
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.11/test_repo/broken_module/model_view_odoo2.xml#L41 Duplicate xml field "key_config" in lines 42
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.11/test_repo/broken_module/model_view_odoo2.xml#L6 Duplicate xml field "name" in lines 13
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.11/test_repo/broken_module/model_view_odoo2.xml#L73 Duplicate xml field "arch" in lines 76
Expand Down
1 change: 1 addition & 0 deletions src/oca_pre_commit_hooks/checks_odoo_module_xml.py
Expand Up @@ -90,6 +90,7 @@ def check_xml_records(self):
field.get("name"),
field.get("context"),
field.get("filter_domain"),
field.get("groups"),
field.getparent(),
)
xml_fields[field_key].append((manifest_data, field))
Expand Down
3 changes: 3 additions & 0 deletions test_repo/broken_module/model_view_odoo2.xml
Expand Up @@ -131,6 +131,9 @@
<tree>
<field name="name"/>
<field name="name"/>

<field name="company_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
<field name="value_ids">
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -16,7 +16,7 @@ setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
# Compatible with "tox --parallel" to avoid concurrency
COVERAGE_FILE={toxinidir}/.coverage_{envname}
COVERAGE_FILE={toxinidir}/.coverage.{envname}
COVERAGE_CONTEXT={envname}
passenv =
*
Expand Down