Skip to Content
Menu
This question has been flagged
5 Replies
9779 Views

I would like to change the zoon value for the map and insert a pin / marker to indicate the company location.

 

I have tried to modify <my odoo folder>/addons/website_crm/controllers/main.py to change the google api code

but it still doesn't reflect the changes even after several server restarts.

 

Robert

Avatar
Discard
Best Answer

I also added a nice map with the insert block of treehouse theme but wouldn't need the default map there. How to remove it totally?

EDIT: 

Found a solution (look the comment, but it is missing the code part in it)


Although, I'd like to edit a xml template in the theme folder for this type of stuff, I did get a solution to edit this now:

Go to Settings -> Technical -> User Interface -> Views

Search for "website.company_description" (or just "company" and select the right one from the filtered list).

Edit the view and comment out the map part of it in the following way:

<!--

<a t-att-href="res_company.google_map_link()" target="_BLANK">

<img class="thumbnail img-responsive" t-att-src="res_company.google_map_img()"/>

</a> -->

You may loose these edits when upgrading Odoo or it's core Website functions but when uninstalling, installing themes, these edits should keep intact.

Avatar
Discard

Although, I'd like to edit a xml template in the theme folder for this type of stuff, I did get a solution to edit this now: Go to Settings -> Technical -> User Interface -> Views Search for "website.company_description" (or just "company" and select the right one from the filtered list). Edit the view and comment out the map part of it in the following way: You may loose these edits when upgrading Odoo or it's core Website functions but when uninstalling, installing themes, these edits should keep intact.

Best Answer

You should create a personal map in your Google Map (with whatever zoom/pin), copy the embed code, then paste it in the Odoo HTML Editor at the right place.

Protip: most of the time, you shouldn't mess with py files for CMS changes.

Avatar
Discard
Author

I already did. but when I embed the code on to the map, by the time I finish saving it, the map reverts back to the previous image. The image is dynamically created and hard coded in main.py The image gets created based on street, city, zip and country of the company address. For the developers: It would be a nice idea to have a Long & Lat field to help narrow down the vicinity location map of a partner map. A selection of pins/markers should be a nice complement.

Author

Is there a way to remove the map on the Contact Us Form? If so, then a new map (with marker) can just be inserted as an image generated from a google api map code.

Author Best Answer

Fabrice,

Thanks for the reply.  I have also thought of creating a new image content ( I have already coded my map to how I want to look like with the pin/marker) but If you are familiar with the Website Contact Form, it comes with a 298x298 map under the company address that Icannot figure out how to delete.  Two maps won't look good on my Contact Form. 

It would be nice if I don't have to mess with the python codes, but it seems its the only way to get the correct map image on the form.

 

Robert

Avatar
Discard