web icon indicating copy to clipboard operation
web copied to clipboard

Widget map first commit

Open drkpkg opened this issue 1 year ago • 5 comments

New widget for OCA web!

I bring you the map field and widget. This widget will help you to add a map (using leaflet) inside the forms.

Xml form:

...
<field name="map_location" widget="location_map" readonly="0"/>
...
from odoo.addons.widget_map.models.map import Map

...
map_location = Map(string="Location", help="Employee location on the map", store=True, default="0.0,0.0")

Feel free to suggest, this is my first contribution to OCA and I hope contribute more!

drkpkg avatar Aug 14 '24 15:08 drkpkg

Thanks @drkpkg for your first contribution. Few remarks for the start to make it better:

  1. You should get rid of pre-commit messages. See here on how to install it: https://github.com/OCA/maintainer-tools/wiki/Install-pre-commit Then just run pre-commit run -a and it will reformat your files, push the changes. Should get rid of pre-commit errors.
  2. See naming commit convention here to improve: https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#commit-message
  3. Also for the contribution to be accepted you need to sign CLA: https://odoo-community.org/about/cla

Rad0van avatar Aug 14 '24 15:08 Rad0van

cc @legalsylvain isn't this similar to https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map ?

pedrobaeza avatar Aug 14 '24 16:08 pedrobaeza

cc @legalsylvain isn't this similar to https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map ?

I think it is kind of, I will check it out to prevent my double work haha.

drkpkg avatar Aug 14 '24 19:08 drkpkg

Thanks @drkpkg for your first contribution. Few remarks for the start to make it better:

  1. You should get rid of pre-commit messages. See here on how to install it: https://github.com/OCA/maintainer-tools/wiki/Install-pre-commit Then just run pre-commit run -a and it will reformat your files, push the changes. Should get rid of pre-commit errors.
  2. See naming commit convention here to improve: https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#commit-message
  3. Also for the contribution to be accepted you need to sign CLA: https://odoo-community.org/about/cla

Thank you for the observations, I'm working to fix this.

drkpkg avatar Aug 14 '24 19:08 drkpkg

Hi @drkpkg. Thanks for your contribution ! Is it the PR ready for review ?

legalsylvain avatar Aug 14 '24 20:08 legalsylvain