Activate the editing of a point without wanting to
Opened this issue · 6 comments
When going from the list view to the map view to view all the points (on my custom module), the markers are shown but one of them is in edit mode.
At the top are the "Save" and "Discard" buttons, if the mark that is "jumping" is moved, the change applies to all the markers in the list. If I use the "discard" button the marker stops jumping and the buttons change to "Create" and "Center Map" as expected from the beginning.
This does not happen in subsequent changes between list and map, until you reload the page (F5).
The point in edit (jumping) coincides with being the first in the list.
I am using Odoo 12 with the web_google_maps-12.0.1.0.7 addon
Below is the detail of the steps::
- In my module I have a list of elements, each element has its own latitude and longitude.
- The map view was configured so that there are 3 views (tree, form and map).
- I reload the page using F5, the icons for the list view and the map view are displayed.
- Click on the map view to see the points, the map is loaded with an edit point as described before..
- After clicking on "Discard" the marker stops jumping.
- The problem is if the user does not use the "Discard" button, he could accidentally alter data
best regards
@diegojuc I couldn't reproduce the issue on my side. Switch from list view to map view looks fine (I'm using a fresh DB loaded with Odoo demo data).
you can check on this demo video
https://user-images.githubusercontent.com/3539144/123553266-68ee7b00-d7a4-11eb-8a40-3a23f90fc8aa.mov
In case I missed a step that caused the issue, please let me know
I attached the test environment that I have used, with docker-compose. It contains the file readme.txt with the detailed steps to reproduce the error in the environment.
and here a short video of the issue
Test.mp4
@diegojuc Found the issue, it's in your view action
<!-- actions opening views on models -->
<record id="mymodule_action_view_tree" model="ir.actions.act_window">
<field name="name">maps points list</field>
<field name="res_model">mymodule</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,map</field>
<field name="context">{'edit_geo_field':True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">No points registered </p>
</field>
</record>
You should not append this value in your general view action
<field name="context">{'edit_geo_field':True}</field>
I would suggest to remove {'edit_geo_field': True}
or... you can keep it, but you have to make sure the view action only render one recordset