Skip to content

[FIX] stock_orderpoint_manual_update: keep qty_forecast in DOM to avoid XPath conflict with Studio#948

Closed
mav-adhoc wants to merge 1 commit into
ingadhoc:18.0from
adhoc-dev:18.0-h-120436-mav
Closed

[FIX] stock_orderpoint_manual_update: keep qty_forecast in DOM to avoid XPath conflict with Studio#948
mav-adhoc wants to merge 1 commit into
ingadhoc:18.0from
adhoc-dev:18.0-h-120436-mav

Conversation

@mav-adhoc

Copy link
Copy Markdown
Contributor

Problem

When Studio is used on the stock.warehouse.orderpoint list view, it raises:

ValueError: El elemento "<xpath expr="//field[@name='qty_forecast']">" no se puede localizar en la vista principal

This happens because stock_orderpoint_manual_update used position="replace" to remove qty_forecast from the DOM entirely and substitute it with qty_forecast_stored. A sibling inherited view (stock.warehouse.orderpoint.tree.inherit) anchors its XPath on //field[@name='qty_forecast']. When Studio's apply_inheritance_specs override processes the view combination and applies the sibling view after the replace, the anchor no longer exists — raising the error.

Fix

Replace position="replace" with position="attributes" (making the field invisible instead of removing it from the DOM), then add qty_forecast_stored via a separate position="after". This keeps qty_forecast as a valid XPath anchor while hiding it from the UI.

<!-- before -->
<field name="qty_forecast" position="replace">
    <field name="qty_forecast_stored"/>
</field>

<!-- after -->
<field name="qty_forecast" position="attributes">
    <attribute name="column_invisible">1</attribute>
</field>
<field name="qty_forecast" position="after">
    <field name="qty_forecast_stored"/>
</field>

@roboadhoc

Copy link
Copy Markdown
Collaborator

Pull request status dashboard

@mav-adhoc mav-adhoc force-pushed the 18.0-h-120436-mav branch 3 times, most recently from b7fb6d4 to 0ed025f Compare June 12, 2026 13:03
@les-adhoc les-adhoc force-pushed the 18.0-h-120436-mav branch from 0ed025f to 8b263da Compare June 12, 2026 14:01
@les-adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc r+ nobump

roboadhoc pushed a commit that referenced this pull request Jun 12, 2026
…id XPath conflict with Studio

closes #948

Signed-off-by: Luciano Esperlazza <les@adhoc.inc>
@roboadhoc roboadhoc closed this Jun 12, 2026
@roboadhoc roboadhoc deleted the 18.0-h-120436-mav branch June 12, 2026 14:26
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.

3 participants