Skip to content

[FIX] spa_resort: prevent error when opening the Contact Us page#1852

Open
assh-odoo wants to merge 1 commit intoodoo:saas-19.1from
odoo-dev:saas-19.1-sentry-7336372498-spa-resort-assh
Open

[FIX] spa_resort: prevent error when opening the Contact Us page#1852
assh-odoo wants to merge 1 commit intoodoo:saas-19.1from
odoo-dev:saas-19.1-sentry-7336372498-spa-resort-assh

Conversation

@assh-odoo
Copy link
Contributor

@assh-odoo assh-odoo commented Mar 16, 2026

Currently, an error occurs when the user opens the Contact Us page.

Steps to Reproduce:

  • Install the spa_resort with demo data.
  • Go to Website > Contact Us.

ValueError: Element '<xpath expr="//t[@t-name='website.contactus']//span[hasclass('s_parallax_bg')]">' cannot be located in parent view

The error starts occurring from saas-19.1 because, after this commit where the Contact Us
page was reworked to better showcase the capabilities of the website builder, the span element
was removed, but the code still references an XPath [1] that was removed from the main view.
As result, opening the Contact Us page raises this error.

This commit replaces the default website aside image with spa resort
related image, as the banner is no longer used in the main view.

[1]-

<xpath expr="//t[@t-name='website.contactus']//span[hasclass('s_parallax_bg')]" position="replace">
<span class="s_parallax_bg oe_img_bg" style="background-image: url('/web/image/spa_resort.ir_attachment_1139'); background-position: 50% 0;"/>

sentry-7336372498

@robodoo
Copy link
Collaborator

robodoo commented Mar 16, 2026

Pull request status dashboard

@assh-odoo assh-odoo requested a review from maan-odoo March 16, 2026 12:26
@assh-odoo assh-odoo marked this pull request as draft March 16, 2026 12:28
@assh-odoo assh-odoo force-pushed the saas-19.1-sentry-7336372498-spa-resort-assh branch 2 times, most recently from f252754 to 4adfbec Compare March 17, 2026 09:56
@maan-odoo maan-odoo marked this pull request as ready for review March 18, 2026 05:11
@C3POdoo C3POdoo requested a review from a team March 18, 2026 05:12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the record isn’t an ideal solution, since you’d still need to adjust the xpath to match the latest code changes. Also, this approach ends up displaying a random image that isn’t relevant to the industry,

Image

Instead you could adapt xpaths something like this

<xpath expr="//t[@t-name='website.contactus']//div[hasclass('col-lg-5')]/img" position="replace">
    <img src="/web/image/spa_resort.ir_attachment_1139" class="img img-fluid rounded" alt=""/>
</xpath>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead you could adapt xpaths something like this

<xpath expr="//t[@t-name='website.contactus']//div[hasclass('col-lg-5')]/img" position="replace">
    <img src="/web/image/spa_resort.ir_attachment_1139" class="img img-fluid rounded" alt=""/>
</xpath>

Thanks for the suggestion.
After applying the new XPath, the image is displayed at half the size compared to the form.

image After discussing this with @dhrs-odoo , I have applied the changes.

Currently, an error occurs when the user opens the Contact Us page.

Steps to Reproduce:
 - Install the spa_resort with demo data.
 - Go to Website > Contact Us.

ValueError: Element '<xpath expr="//t[@T-name='website.contactus']//span[hasclass('s_parallax_bg')]">' cannot be located in parent view

The error starts occurring from saas-19.1 because, after [this commit]
where the Contact Us page was reworked to better showcase the capabilities
of the website builder, the span element was replaced, but the code
still references an XPath [1] that was removed from the main view. As
result, opening the Contact Us page raises this error.

This commit replaces the default website aside image with a spa resort
related image, as the banner is no longer used in the main view.

[this commit]: odoo/odoo@ba8d1f6#diff-409cc7362c7557970ce7506fc9a1097c37c7869b7cd815ce463db38a3b7a8239

[1]: https://github.com/odoo/industry/blob/bdbdd15f11f3304f192f44a7baf0743520ba8ae6/spa_resort/demo/website_view.xml#L308-L309

[2]: https://github.com/odoo/odoo/blob/072a8e4fd061ff23902e6e448a577624cb27e188/addons/website/data/website_data.xml#L35-L36

sentry-7336372498
@assh-odoo assh-odoo force-pushed the saas-19.1-sentry-7336372498-spa-resort-assh branch from 4adfbec to 61663a8 Compare March 18, 2026 06:42
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.

4 participants