odoo-addons icon indicating copy to clipboard operation
odoo-addons copied to clipboard

Activate the editing of a point without wanting to

Open diegojuc opened this issue 3 years ago • 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::

  1. In my module I have a list of elements, each element has its own latitude and longitude.
  2. The map view was configured so that there are 3 views (tree, form and map).
  3. I reload the page using F5, the icons for the list view and the map view are displayed. image1
  4. Click on the map view to see the points, the map is loaded with an edit point as described before.. image2
  5. After clicking on "Discard" the marker stops jumping. image3
  6. The problem is if the user does not use the "Discard" button, he could accidentally alter data

best regards

diegojuc avatar Jun 25 '21 12:06 diegojuc

Hi @diegojuc

Thanks for reporting this issue I'll check

gityopie avatar Jun 26 '21 09:06 gityopie

@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

gityopie avatar Jun 27 '21 17:06 gityopie

Hello, thank you for your support, in the course of this week I will try to set up tests in an environment similar to yours and I will tell you the results.

El dom., 27 de junio de 2021 11:08 a. m., Yopi Angi < @.***> escribió:

@diegojuc https://github.com/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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gityopie/odoo-addons/issues/165#issuecomment-869195547, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQHWPVVUXWOOWVO33RMMTDTU5LHVANCNFSM47JZAQOA .

diegojuc avatar Jun 27 '21 21:06 diegojuc

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.

mapsTest.zip

and here a short video of the issue

https://user-images.githubusercontent.com/23100222/124036865-ea6c2600-d9bb-11eb-827d-8b5ed2f94a2c.mp4

diegojuc avatar Jun 30 '21 22:06 diegojuc

@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

gityopie avatar Jul 01 '21 15:07 gityopie

@diegojuc Apologize for the unclear documentation, I will update it Thank you for your feedback 🙏

gityopie avatar Jul 01 '21 15:07 gityopie