Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to edit Website Contact Form location map?

By
infomate
on 9/11/14, 10:27 PM 2,980 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

0
S. Edelman
On 5/31/15, 5:13 PM

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.

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.

S. Edelman
on 6/1/15, 5:55 AM
0

Fabrice Henrion (fhe)

--Fabrice Henrion (fhe)--
5813
| 7 7 8
San Francisco, United States
--Fabrice Henrion (fhe)--

Director Odoo USA

Fabrice Henrion (fhe)
On 9/11/14, 11:07 PM

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.

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.

infomate
on 9/12/14, 3:55 AM

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.

infomate
on 9/15/14, 4:14 AM
0
infomate
On 9/12/14, 12:15 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/11/14, 10:27 PM
Seen: 2980 times
Last updated: 6/1/15, 5:58 AM