Skip to content

[FIX] test_generic: improve test using ast instead of regex#1906

Closed
fw-bot wants to merge 1 commit into
odoo:saas-18.3from
odoo-dev:saas-18.3-saas-18.2-replace-regex-with-ast-vava-510663-fw
Closed

[FIX] test_generic: improve test using ast instead of regex#1906
fw-bot wants to merge 1 commit into
odoo:saas-18.3from
odoo-dev:saas-18.3-saas-18.2-replace-regex-with-ast-vava-510663-fw

Conversation

@fw-bot

@fw-bot fw-bot commented Mar 26, 2026

Copy link
Copy Markdown

There is a test ensuring that there is no use of search([...]).id
without adding a limit=1 (or using .ids). This test was relying on a
complicated regex. This commit improves the test by relying on ast and
corrects remaining occurrences that were not raised by previous version
of the test.

opw-6037120

Forward-Port-Of: #1894

@robodoo

robodoo commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

Pull request status dashboard

@fw-bot

fw-bot commented Mar 26, 2026

Copy link
Copy Markdown
Author

@vava-odoo @pgu-odoo cherrypicking of pull request #1894 failed.

stdout:

Auto-merging bike_leasing/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in bike_leasing/demo/website_theme_apply.xml
Auto-merging bike_shop/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in bike_shop/demo/website_theme_apply.xml
Auto-merging coal_petroleum/demo/purchase_order_post.xml
Auto-merging electronic_store/demo/purchase_order_post.xml
Auto-merging electronic_store/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in electronic_store/demo/website_theme_apply.xml
Auto-merging fmcg_store/demo/purchase_order_post.xml
Auto-merging furniture_store/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in furniture_store/demo/website_theme_apply.xml
Auto-merging gallery/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in gallery/demo/website_theme_apply.xml
Auto-merging hair_salon/demo/website_builder.xml
CONFLICT (content): Merge conflict in hair_salon/demo/website_builder.xml
Auto-merging headhunter/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in headhunter/demo/website_theme_apply.xml
Auto-merging marketing_agency/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in marketing_agency/demo/website_theme_apply.xml
Auto-merging micro_brewery/data/website_view.xml
CONFLICT (content): Merge conflict in micro_brewery/data/website_view.xml
Auto-merging micro_brewery/demo/purchase_order_post.xml
CONFLICT (content): Merge conflict in micro_brewery/demo/purchase_order_post.xml
Auto-merging micro_brewery/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in micro_brewery/demo/website_theme_apply.xml
Auto-merging pharmacy_retail/demo/purchase_order_post.xml
Auto-merging real_estate/data/website_theme_apply.xml
CONFLICT (content): Merge conflict in real_estate/data/website_theme_apply.xml
Auto-merging real_estate/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in real_estate/demo/website_theme_apply.xml
Auto-merging solar_installation/demo/project_task_post.xml
Auto-merging solar_installation/demo/purchase_order_post.xml
Auto-merging solar_installation/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in solar_installation/demo/website_theme_apply.xml
Auto-merging sports_club/demo/website_theme_apply.xml
CONFLICT (content): Merge conflict in sports_club/demo/website_theme_apply.xml
Auto-merging tests/test_generic/tests/test_xml.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@vava-odoo vava-odoo force-pushed the saas-18.3-saas-18.2-replace-regex-with-ast-vava-510663-fw branch from 5036661 to 3c459bb Compare March 26, 2026 12:27
There is a test ensuring that there is no use of `search([...]).id`
without adding a `limit=1` (or using .ids). This test was relying on a
complicated regex. This commit improves the test by relying on `ast` and
corrects remaining occurrences that were not raised by previous version
of the test.

X-original-commit: c866a0b
@vava-odoo vava-odoo force-pushed the saas-18.3-saas-18.2-replace-regex-with-ast-vava-510663-fw branch from 3c459bb to dca456f Compare March 26, 2026 14:34
@vava-odoo

Copy link
Copy Markdown
Collaborator

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 26, 2026
There is a test ensuring that there is no use of `search([...]).id`
without adding a `limit=1` (or using .ids). This test was relying on a
complicated regex. This commit improves the test by relying on `ast` and
corrects remaining occurrences that were not raised by previous version
of the test.

closes #1906

X-original-commit: c866a0b
Signed-off-by: Pratima Gupta (pgu) <pgu@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
robodoo pushed a commit that referenced this pull request Mar 26, 2026
There is a test ensuring that there is no use of `search([...]).id`
without adding a `limit=1` (or using .ids). This test was relying on a
complicated regex. This commit improves the test by relying on `ast` and
corrects remaining occurrences that were not raised by previous version
of the test.

closes #1906

X-original-commit: c866a0b
Signed-off-by: Pratima Gupta (pgu) <pgu@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
@robodoo robodoo closed this Mar 26, 2026
@fw-bot fw-bot deleted the saas-18.3-saas-18.2-replace-regex-with-ast-vava-510663-fw branch April 2, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants