Search 1.9 billion lines of Odoo code on GitHub

web_google_maps

Author: Yopi Angi
License: AGPL-3
Branch: 8.0
Repository: Yenthe666/auto_backup
Dependencies: base, base_geolocalize, base_setup, and web
Languages: CSS (129, 3.4%), HTML (74, 2.0%), JavaScript (2743, 72.9%), LESS (83, 2.2%), Markdown (255, 6.8%), Python (231, 6.1%), and XML (249, 6.6%)
Other repositories: Andyeyo/Odoo-Addons, Bilbonet/odoo-addons, DITIntl/odoo-addons-1, GiraffosCom/odoo-cl-12, Gonscar88/odoo-addons, Guobower/Odoo-Addons-2, Idealisconsulting/odoo-addons, Infinityloopsistemas/odoo-addons, Kalway-Technology/odoo-addons, KurrufERP/odoo-cl-12, LevelPrime/odoo-google-maps, Loo-ERP/odoo-addons, Manuellama/odoo-addons, Mefistous/odoo-cl-12, NivasRaj/odoo-addons, Normatica/odoo-cl-12, NothingCtrl/odoo-addons, OdooBulgaria/Odoo-Addons-17, OdooBulgaria/odoo-addons-15, RL-OtherApps/odoo-addons-2, SDIsl/geolocation, SantosJMM/odoo-addons, Sroeurnsuon/odoo-addons, TheCloneMaster/Odoo-Addons, UnknownInfo/odoo-cl-12, Vassy/odoo-addons, VizThoughts/odoo-addons-2, abdalmola-apps/odoo-addons, alvarojimenezpaz/odoo-cl-12, anhvu-sg/odoo-addons, aschenkels-ictstudio/odoo-addons-1, azizulj8/odoo-addons, be-cloud-be/odoo-addons, bgavarini/odoo-addons, bimajatiwijaya/odoo-addons, bishalgit/odoo-addons, brain-tec/odoo-addons, cameleonRuoi/odoo-addons, consultingerp/crm_maps-12, daemondev/Odoo-Addons, dansanti/odoo-addons, desiteg/odoo-addons, diegobgl/odoo-addons, dong-z/odoo-addons, dtka0105/odoo-addons, erick-alvino/odoo-addons-1, erlopezh/odoo-addons, flectra-chile/odoo-cl-12, fva-idealis/odoo-addons, gitstalker/odoo-addons-1, gityopie/odoo-addons, grupoebox/odoo-addons, guohuadeng/odoo-addons, gustotc/odoo-addons, halybang/odoo-addons, hashirharis/odoo-addons, hippe-67/odoo-addons, hoangpq/odoo-addons-web-gg, iledarn/odoo-addons, intellego-bi/odoo-12, intellego-bi/odoo-cl-12, iuppiterpluvius/odoo-addons, jason156/Odoo-Addons-4, jeffersonjeff/odoo-addons, josemoralesp/odoo-addons, jriveros/odoo-cl-12, katyukha/odoo-addons, killteck/odoo-addons, kit9/odoo-addons-2, leodoooca/gityopie-odoo-addons, litnimax/odoo-addons, marcel1981/odoo-cl-12, marcelomora/yopie, marcelsavegnago/odoo-addons-3, martinllanos/odoo-addons, maurolguin1/odoo-cl-12, mgielissen/odoo-addons-7, minhhq09/odoo-addons, nerkusoft/odoo-addons, nextmoveits/odoo-addons, nguyenductamlhp/odoo-addons, nick2474/odoo-addons-1, nikeshscs/odoo-addons, njeudy/odoo-addons, nknganda/odoo-addons, odoochain/odoo-addons, odoogap/odoo-addons, odoonz/misc-gityopie, ohernandez-getinsoft/odoo-addons, one2pret/odoo-addons, osvalr/Odoo-Addons, petypi/odoo-addons-2, pnajman-modoolar/odoo-addons, redcor/field-service, sadeqamin/odoo-addons, sc4you/odoo-addons-3, scbrianti/odoo-addons, sgheller/odoo-addons, sm2x/odoo-addons, spoerp/odoo-addons, t-np/odoo-addons, tate11/odoo-addons-6, thanhdongcntt/odoo-addons, udamuri/odoo-addons, ursais/odoo-addons, vidtsin/odoo-cl-12, wahello/odoo-addons, westlyou/Odoo-Addons-4, westlyou/odoo-addons-2, xpertiz/odoo-addons, zarumaru/odoo-addons, and zoubir/odoo-addons

<h1>Web Google Maps</h1> <p><a href="https://youtu.be/5hvAubXgUnc" title="Demo"><img src="https://i.ytimg.com/vi/2UdG5ILDtiY/3.jpg" alt="Demo"></a> </p> <p>This module contains three new features: - New view type and mode <code>map</code> - New widget <code>gplaces_address_autocomplete</code> - New widget <code>gplaces_autocomplete</code></p> <h1>Map view <code>&quot;map&quot;</code></h1> <p>Basically, this new view <code>map</code> will integrate Google Maps into Odoo.<br> Enable you to display <code>res.partner</code> geolocation on map or any model contains geolocation.<br> This feature will work seamlessly with Odoo means you can search your partner location using Odoo search feature. </p> <p>There are five available attributes that you can customize - <code>lat</code> : an attritube to tell the map the latitude field on the object <strong>[mandatory]</strong> - <code>lng</code> : an attritute to tell the map the longitude field on the object <strong>[mandatory]</strong> - <code>color</code> : an attribute to modify marker color (optional) any given color will set all markers color <strong>[optional]</strong>. - <code>colors</code> : work like attribute <code>color</code> but more configurable (you can set marker color depends on it&#39;s value) this attribute works similar to <code>colors</code> of tree view on Odoo 9.0 <strong>[optional]</strong> - <code>library</code> : an attribute to tell map which map that will be loaded <strong>[mandatory]</strong>.<br> This options has two values:<br> 1. <code>geometry</code> 2. <code>drawing</code></p> <p>How to create the view?<br> Example</p> <blockquote> <pre><code>&lt;!-- View --&gt; &lt;record id=&quot;view_res_partner_map&quot; model=&quot;ir.ui.view&quot;&gt; &lt;field name=&quot;name&quot;&gt;view.res.partner.map&lt;/field&gt; &lt;field name=&quot;model&quot;&gt;res.partner&lt;/field&gt; &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt; &lt;map class=&quot;o_res_partner_map&quot; library=&#39;geometry&#39; string=&quot;Map&quot; lat=&quot;partner_latitude&quot; lng=&quot;partner_longitude&quot; colors=&quot;blue:company_type==&#39;person&#39;;green:company_type==&#39;company&#39;;&quot;&gt; &lt;field name=&quot;id&quot;/&gt; &lt;field name=&quot;partner_latitude&quot;/&gt; &lt;field name=&quot;partner_longitude&quot;/&gt; &lt;field name=&quot;company_type&quot;/&gt; &lt;field name=&quot;color&quot;/&gt; &lt;field name=&quot;display_name&quot;/&gt; &lt;field name=&quot;title&quot;/&gt; &lt;field name=&quot;email&quot;/&gt; &lt;field name=&quot;parent_id&quot;/&gt; &lt;field name=&quot;is_company&quot;/&gt; &lt;field name=&quot;function&quot;/&gt; &lt;field name=&quot;phone&quot;/&gt; &lt;field name=&quot;street&quot;/&gt; &lt;field name=&quot;street2&quot;/&gt; &lt;field name=&quot;zip&quot;/&gt; &lt;field name=&quot;city&quot;/&gt; &lt;field name=&quot;country_id&quot;/&gt; &lt;field name=&quot;mobile&quot;/&gt; &lt;field name=&quot;state_id&quot;/&gt; &lt;field name=&quot;category_id&quot;/&gt; &lt;field name=&quot;image_small&quot;/&gt; &lt;field name=&quot;type&quot;/&gt; &lt;templates&gt; &lt;t t-name=&quot;kanban-box&quot;&gt; &lt;div class=&quot;oe_kanban_global_click o_res_partner_kanban&quot;&gt; &lt;div class=&quot;o_kanban_image&quot;&gt; &lt;t t-if=&quot;record.image_small.raw_value&quot;&gt; &lt;img t-att-src=&quot;kanban_image(&#39;res.partner&#39;, &#39;image_small&#39;, record.id.raw_value)&quot;/&gt; &lt;/t&gt; &lt;t t-if=&quot;!record.image_small.raw_value&quot;&gt; &lt;t t-if=&quot;record.type.raw_value === &#39;delivery&#39;&quot;&gt; &lt;img t-att-src=&#39;_s + &quot;/base/static/src/img/truck.png&quot;&#39; class=&quot;o_kanban_image oe_kanban_avatar_smallbox&quot;/&gt; &lt;/t&gt; &lt;t t-if=&quot;record.type.raw_value === &#39;invoice&#39;&quot;&gt; &lt;img t-att-src=&#39;_s + &quot;/base/static/src/img/money.png&quot;&#39; class=&quot;o_kanban_image oe_kanban_avatar_smallbox&quot;/&gt; &lt;/t&gt; &lt;t t-if=&quot;record.type.raw_value != &#39;invoice&#39; &amp;amp;&amp;amp; record.type.raw_value != &#39;delivery&#39;&quot;&gt; &lt;t t-if=&quot;record.is_company.raw_value === true&quot;&gt; &lt;img t-att-src=&#39;_s + &quot;/base/static/src/img/company_image.png&quot;&#39;/&gt; &lt;/t&gt; &lt;t t-if=&quot;record.is_company.raw_value === false&quot;&gt; &lt;img t-att-src=&#39;_s + &quot;/base/static/src/img/avatar.png&quot;&#39;/&gt; &lt;/t&gt; &lt;/t&gt; &lt;/t&gt; &lt;/div&gt; &lt;div class=&quot;oe_kanban_details&quot;&gt; &lt;strong class=&quot;o_kanban_record_title oe_partner_heading&quot;&gt; &lt;field name=&quot;display_name&quot;/&gt; &lt;/strong&gt; &lt;div class=&quot;o_kanban_tags_section oe_kanban_partner_categories&quot;&gt; &lt;span class=&quot;oe_kanban_list_many2many&quot;&gt; &lt;field name=&quot;category_id&quot; widget=&quot;many2many_tags&quot; options=&quot;{&#39;color_field&#39;: &#39;color&#39;}&quot;/&gt; &lt;/span&gt; &lt;/div&gt; &lt;ul&gt; &lt;li t-if=&quot;record.parent_id.raw_value and !record.function.raw_value&quot;&gt; &lt;field name=&quot;parent_id&quot;/&gt; &lt;/li&gt; &lt;li t-if=&quot;!record.parent_id.raw_value and record.function.raw_value&quot;&gt; &lt;field name=&quot;function&quot;/&gt; &lt;/li&gt; &lt;li t-if=&quot;record.parent_id.raw_value and record.function.raw_value&quot;&gt; &lt;field name=&quot;function&quot;/&gt; at &lt;field name=&quot;parent_id&quot;/&gt; &lt;/li&gt; &lt;li t-if=&quot;record.city.raw_value and !record.country_id.raw_value&quot;&gt; &lt;field name=&quot;city&quot;/&gt; &lt;/li&gt; &lt;li t-if=&quot;!record.city.raw_value and record.country_id.raw_value&quot;&gt; &lt;field name=&quot;country_id&quot;/&gt; &lt;/li&gt; &lt;li t-if=&quot;record.city.raw_value and record.country_id.raw_value&quot;&gt; &lt;field name=&quot;city&quot;/&gt; , &lt;field name=&quot;country_id&quot;/&gt; &lt;/li&gt; &lt;li t-if=&quot;record.email.raw_value&quot; class=&quot;o_text_overflow&quot;&gt; &lt;field name=&quot;email&quot;/&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div class=&quot;oe_kanban_partner_links&quot;/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/t&gt; &lt;/templates&gt; &lt;/map&gt; &lt;/field&gt; &lt;/record&gt; </code></pre> </blockquote> <pre><code>&lt;!-- Action --&gt; &lt;record id=&quot;action_partner_map&quot; model=&quot;ir.actions.act_window&quot;&gt; ... &lt;field name=&quot;view_type&quot;&gt;form&lt;/field&gt; &lt;field name=&quot;view_mode&quot;&gt;tree,form,map&lt;/field&gt; ... &lt;/record&gt; </code></pre> <p>The view looks familiar?<br> Yes, you&#39;re right.<br> The marker infowindow will use <code>kanban-box</code> kanban card style. </p> <h3>How to setup color for marker on map?</h3> <p>There are two attributes: - <code>colors</code> - <code>color</code> </p> <p>Example:</p> <blockquote> <pre><code>&lt;!-- colors --&gt; &lt;map string=&quot;Map&quot; lat=&quot;partner_latitude&quot; lng=&quot;partner_longitude&quot; colors=&quot;green:company_type==&#39;person&#39;;blue:company_type==&#39;company&#39;;&quot;&gt; ... &lt;/map&gt; </code></pre> </blockquote> <pre><code>&lt;!-- color --&gt; &lt;map string=&quot;Map&quot; lat=&quot;partner_latitude&quot; lng=&quot;partner_longitude&quot; color=&quot;orange&quot;&gt; ... &lt;/map&gt; </code></pre> <h1>New widget <code>&quot;gplaces_address_autocomplete&quot;</code></h1> <p>New widget to integrate <a href="https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform">Place Autocomplete Address Form</a> in Odoo.<br> The widget has four options that can be modify: - <code>component_form</code> - <code>fillfields</code> - <code>lat</code> - <code>lng</code></p> <h3>Component form <code>component_form</code></h3> <p>Is an option used to modify which value you want to take from an objects returned by the geocoder.<br> Full documentation about Google component types can be found <a href="https://developers.google.com/maps/documentation/geocoding/intro#Types">here</a> By default this option are configured like the following value</p> <blockquote> <pre><code>{ &#39;street_number&#39;: &#39;long_name&#39;, &#39;route&#39;: &#39;long_name&#39;, &#39;intersection&#39;: &#39;short_name&#39;, &#39;political&#39;: &#39;short_name&#39;, &#39;country&#39;: &#39;short_name&#39;, &#39;administrative_area_level_1&#39;: &#39;short_name&#39;, &#39;administrative_area_level_2&#39;: &#39;short_name&#39;, &#39;administrative_area_level_3&#39;: &#39;short_name&#39;, &#39;administrative_area_level_4&#39;: &#39;short_name&#39;, &#39;administrative_area_level_5&#39;: &#39;short_name&#39;, &#39;colloquial_area&#39;: &#39;short_name&#39;, &#39;locality&#39;: &#39;short_name&#39;, &#39;ward&#39;: &#39;short_name&#39;, &#39;sublocality_level_1&#39;: &#39;short_name&#39;, &#39;sublocality_level_2&#39;: &#39;short_name&#39;, &#39;sublocality_level_3&#39;: &#39;short_name&#39;, &#39;sublocality_level_5&#39;: &#39;short_name&#39;, &#39;neighborhood&#39;: &#39;short_name&#39;, &#39;premise&#39;: &#39;short_name&#39;, &#39;postal_code&#39;: &#39;short_name&#39;, &#39;natural_feature&#39;: &#39;short_name&#39;, &#39;airport&#39;: &#39;short_name&#39;, &#39;park&#39;: &#39;short_name&#39;, &#39;point_of_interest&#39;: &#39;long_name&#39; } </code></pre> </blockquote> <p>This configuration can be modify into view field definition.<br> Example:</p> <blockquote> <pre><code>&lt;record id=&quot;view_res_partner_form&quot; model=&quot;ir.ui.view&quot;&gt; ... &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt; ... &lt;field name=&quot;street&quot; widget=&quot;gplaces_address_form&quot; options=&quot;{&#39;component_form&#39;: {&#39;street_number&#39;: &#39;short_name&#39;}}&quot;/&gt; ... &lt;/field&gt; &lt;/record&gt; </code></pre> </blockquote> <h3>Fill fields <code>fillfields</code></h3> <p>Is an option that will be influenced by <code>gplaces_address_autocomplete</code> widget.<br> This options should contains known <code>fields</code> that you want the widget to fulfill a value for each given field automatically.<br> A field can contains one or multiple elements of component form<br> By default this options are configured like the following</p> <blockquote> <pre><code>{ &#39;street&#39;: [&#39;street_number&#39;, &#39;route&#39;], &#39;street2&#39;: [&#39;administrative_area_level_3&#39;, &#39;administrative_area_level_4&#39;, &#39;administrative_area_level_5&#39;], &#39;city&#39;: [&#39;locality&#39;, &#39;administrative_area_level_2&#39;], &#39;zip&#39;: &#39;postal_code&#39;, &#39;state_id&#39;: &#39;administrative_area_level_1&#39;, &#39;country_id&#39;: &#39;country&#39;, } </code></pre> </blockquote> <p>This configuration can be modify into view field definition as well<br> Example:</p> <blockquote> <pre><code>&lt;record id=&quot;view_res_partner_form&quot; model=&quot;ir.ui.view&quot;&gt; ... &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt; ... &lt;field name=&quot;street&quot; widget=&quot;google_places&quot; options=&quot;{&#39;fillfields&#39;: {&#39;street2&#39;: [&#39;route&#39;, &#39;street_number&#39;]}}&quot;/&gt; ... &lt;/field&gt; &lt;/record&gt; </code></pre> </blockquote> <h3>Latitude <code>lat</code> and Longitude <code>lng</code></h3> <p>This options tell the widget the fields geolocation, in order to have this fields filled automatically.</p> <h1>New widget <code>&quot;gplaces_autocomplete&quot;</code></h1> <p>New widget to integrate <a href="https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete">Place Autocomplete</a> in Odoo. This widget have similar configuration to <code>gplaces_address_autocomplete</code>.</p> <h3>Component form <code>component_form</code></h3> <p>Same configuration of <code>gplaces_address_autocomplete</code> component form</p> <h3>Fill fields <code>fillfields</code></h3> <p>This configuration works similar to <code>gplaces_address_autocomplete</code>. By default this options are configured like following value:</p> <blockquote> <pre><code>{ general: { name: &#39;name&#39;, website: &#39;website&#39;, phone: [&#39;international_phone_number&#39;, &#39;formatted_phone_number&#39;] }, geolocation: { partner_latitude: &#39;latitude&#39;, partner_longitude: &#39;longitude&#39; }, address: { street: [&#39;street_number&#39;, &#39;route&#39;], street2: [&#39;administrative_area_level_3&#39;, &#39;administrative_area_level_4&#39;, &#39;administrative_area_level_5&#39;], city: [&#39;locality&#39;, &#39;administrative_area_level_2&#39;], zip: &#39;postal_code&#39;, state_id: &#39;administrative_area_level_1&#39;, country_id: &#39;country&#39; } }; </code></pre> </blockquote> <h1>Technical</h1> <p>This module will install <code>base_setup</code> and <code>base_geolocalize</code>.<br> <em>I recommend you to setup <strong>Google Maps Key API</strong> and add it into Odoo <code>Settings &gt; General</code> Settings when you installed this module</em></p> <p><em><strong>List of Google APIs &amp; services required in order to make all features works</strong></em> - Geocoding API - Maps JavaScript API - Places API for Web</p> <p>The goal of this module is to bring the power of Google Maps into Odoo<br> This module has tested on Odoo Version 11.0c </p> <p><a href="https://ko-fi.com/P5P4FOM0"><img src="https://www.ko-fi.com/img/donate_sm.png" alt="ko-fi"></a><br> <em>if you want to support me to keep this project maintained. Thanks :)</em></p>