Skip to content

[FIX] web_view_leaflet_map: reload markers on search domain change#462

Closed
Jonasaaaa wants to merge 1 commit into
OCA:18.0from
Jonasaaaa:18.0-fix-web_view_leaflet_map-search-domain
Closed

[FIX] web_view_leaflet_map: reload markers on search domain change#462
Jonasaaaa wants to merge 1 commit into
OCA:18.0from
Jonasaaaa:18.0-fix-web_view_leaflet_map-search-domain

Conversation

@Jonasaaaa

Copy link
Copy Markdown

Problem

On the leaflet_map view, applying a search filter or favorite does
not update the markers. The renderer loads its records only in onWillStart
and never reacts to later domain changes; onPatched re-renders the markers
but from the same, stale this.records. As a result the map keeps showing all
records regardless of the active search.

Fix

Add an onWillUpdateProps hook that reloads the records with the new
domain/context before the component is patched. loadRecords now accepts
an optional domain/context (falling back to this.props), so the filtered
result is fetched and onPatched then re-renders the up-to-date markers.

No change to the view API; filtering now works on every leaflet_map view.

How to test

  1. Open any action using a leaflet_map view with a search view that has
    filters (e.g. web_view_leaflet_map_partner).
  2. Apply a filter or favorite.
  3. Before: markers are unchanged. After: markers reflect the filtered records.

The map renderer only loaded its records on willStart, so applying a search
filter or favorite never refreshed the markers (onPatched re-rendered the
same, stale records).

Add onWillUpdateProps to reload the records with the new domain/context;
loadRecords now accepts an optional domain/context so the filtered result is
fetched before onPatched re-renders the markers.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added mod:web_view_leaflet_map Module web_view_leaflet_map series:18.0 labels May 31, 2026
@Jonasaaaa

Copy link
Copy Markdown
Author

Closing: the fix belongs on the 19.0 line (built on the ongoing migration PR #459), not on 18.0. Superseded accordingly.

@Jonasaaaa Jonasaaaa closed this May 31, 2026
@Jonasaaaa Jonasaaaa deleted the 18.0-fix-web_view_leaflet_map-search-domain branch May 31, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:web_view_leaflet_map Module web_view_leaflet_map series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants