Jelajahi Sumber

Mapa de acuerdo a la dirección

sebas 5 tahun lalu
melakukan
4413796c3f

+ 20 - 0
__init__.py

@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+######################################################################################################
+#
+# Copyright (C) B.H.C. sprl - All Rights Reserved, http://www.bhc.be
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+# including but not limited to the implied warranties
+# of merchantability and/or fitness for a particular purpose
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>
+######################################################################################################
+import models

+ 36 - 0
__openerp__.py

@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+######################################################################################################
+#
+# Copyright (C) B.H.C. sprl - All Rights Reserved, http://www.bhc.be
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+# including but not limited to the implied warranties
+# of merchantability and/or fitness for a particular purpose
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>
+######################################################################################################
+{
+    'name': 'Google Maps',
+    'version': '1.0',
+    'category': 'Extra Tools',
+    'description': """This module adds a Map button on the partner’s form in order to open its address directly in the Google Maps view""",
+    'author': 'BHC & Odoo',
+    'website': 'www.bhc.be',
+    'depends': ['base'],
+    'init_xml': [],
+    'images': ['static/description/banner.png','images/google_map.png','images/map.png','images/earth.png'],
+    'data': [
+            'views/res_partner_view.xml',
+            ],
+    'installable': True,
+    'auto_install': False,
+    'license': 'LGPL-3',
+}

+ 27 - 0
i18n/fr.po

@@ -0,0 +1,27 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* google_map
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0-20130409-232349\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-18 08:33+0000\n"
+"PO-Revision-Date: 2013-09-18 08:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: google_map
+#: view:res.partner:0
+msgid "Map"
+msgstr "Plan/Carte"
+
+#. module: google_map
+#: model:ir.model,name:google_map.model_res_partner
+msgid "Partner"
+msgstr "Partenaire"
+

TEMPAT SAMPAH
images/google_map.png


+ 20 - 0
models/__init__.py

@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+######################################################################################################
+#
+# Copyright (C) B.H.C. sprl - All Rights Reserved, http://www.bhc.be
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+# including but not limited to the implied warranties
+# of merchantability and/or fitness for a particular purpose
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>
+######################################################################################################
+import res_partner

+ 45 - 0
models/res_partner.py

@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+######################################################################################################
+#
+# Copyright (C) B.H.C. sprl - All Rights Reserved, http://www.bhc.be
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+# including but not limited to the implied warranties
+# of merchantability and/or fitness for a particular purpose
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>
+######################################################################################################
+from openerp.tools.translate import _ 
+from openerp import api, fields, tools, exceptions, models, _
+
+
+class ResPartner(models.Model):
+    _inherit = "res.partner"
+
+    @api.multi
+    def open_map(self):
+        for partner in self:
+            url = "http://maps.google.com/maps?oi=map&q="
+            if partner.street:
+                url += partner.street.replace(' ', '+')
+            if partner.city:
+                url += '+'+partner.city.replace(' ', '+')
+            if partner.state_id:
+                url += '+'+partner.state_id.name.replace(' ', '+')
+            if partner.country_id:
+                url += '+'+partner.country_id.name.replace(' ', '+')
+            if partner.zip:
+                url += '+'+partner.zip.replace(' ', '+')
+        return {
+            'type': 'ir.actions.act_url',
+            'target': 'new',
+            'url': url
+        }

TEMPAT SAMPAH
static/description/banner.png


TEMPAT SAMPAH
static/description/community.png


TEMPAT SAMPAH
static/description/customer.png


TEMPAT SAMPAH
static/description/customization.png


TEMPAT SAMPAH
static/description/enterprise.png


TEMPAT SAMPAH
static/description/helpdesk.png


TEMPAT SAMPAH
static/description/icon.png


+ 140 - 0
static/description/index.html

@@ -0,0 +1,140 @@
+<section class="container">
+	<div class="oe_row oe_spaced" >
+		<h3 class="oe_slogan" >Google Map</h3>
+		<p class="oe_mt16" style="line-height: 190%;">
+			Locate your contact in one click.
+		</p>
+	</div>
+</section>
+<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
+	<li class="nav-item">
+		<a class="nav-link active" id="pills-description-tab" data-toggle="pill" href="#pills-description" role="tab" aria-controls="pills-description" aria-selected="true">Description</a>
+	</li>
+	<li class="nav-item">
+		<a class="nav-link" id="pills-support-tab" data-toggle="pill" href="#pills-support" role="tab" aria-controls="pills-support" aria-selected="false">Contact</a>
+	</li>
+	<li class="nav-item">
+		<a class="nav-link" id="pills-apps-tab" data-toggle="pill" href="#pills-apps" role="tab" aria-controls="pills-apps" aria-selected="false">Suggested apps</a>
+	</li>
+</ul>
+<div class="tab-content" id="pills-tabContent">
+	<div class="tab-pane show active" id="pills-description" role="tabpanel" aria-labelledby="pills-description-tab">
+		<div class="oe_row oe_spaced">
+			<div style="max-width:1000px;width: auto;margin: 0 auto;display:block;text-align:center;">
+				<span class="col">
+					<img class="img img-responsive" src="community.png" style="box-shadow:unset;max-height: unset;max-width: 75%;width: auto;">
+				</span>
+				<span class="col">
+					<img class="img img-responsive" src="enterprise.png" style="margin:20px;max-height: unset;max-width: 75%;width: auto;">
+				</span>
+			</div>
+		</div>
+		<div class="oe_row oe_spaced">
+			<h3 class="oe_slogan" >Direct view of your contact's location</h3>
+			<div style="max-width:1000px;width: auto;margin: 0 auto;display:block;text-align:center;">
+				<p>
+					Adds a direct link on your contact to Google Map.
+				</p>
+				<p>
+					<img src="customer.png" class="img img-fluid mx-auto" alt="ScreenshotCustomer">
+				</p>
+			</div>
+		</div>
+		<div class="oe_row oe_spaced">
+			<h3 class="oe_slogan" >Customer Map</h3>
+			<div style="max-width:1000px;width: auto;margin: 0 auto;display:block;text-align:center;">
+				<p>
+					You will be redirected on Google map with the precise contact's location.
+					Position information computed with the contact's address
+				</p>
+				<p>
+					<img src="map.png" class="img img-fluid mx-auto" alt="ScreenshotMap">
+				</p>
+			</div>
+		</div>
+	</div>
+	<div class="tab-pane" id="pills-support" role="tabpanel" aria-labelledby="pills-support-tab">
+		<div class="container">
+			<div class="row align-items-center">
+				<div class="col-lg-6 pt16 pb16">
+					<h2 class="o_default_snippet_text">Need help?</h2>
+					<p class="o_default_snippet_text">
+						Please send us an email to support@bhc.be if you have any issue or question.
+					</p>
+					<div class="s_btn text-left pt16 pb16" data-name="Buttons">
+						<a href="https://odoo.bhc.be/page/contact" class="btn btn-primary o_default_snippet_text">Help Request</a>
+					</div>
+				</div>
+				<div class="col-lg-6 pt16 pb16">
+					<img src="helpdesk.png" class="img img-fluid mx-auto" alt="Helpdesk" data-original-title="" title="">
+				</div>
+			</div>
+		</div>
+		<div class="container">
+			<div class="row align-items-center">
+				<div class="col-lg-6 pt16 pb16">
+					<img src="customization.png" class="img img-fluid mx-auto" alt="Customization">
+				</div>
+				<div class="col-lg-6 pt16 pb16">
+					<h2 class="o_default_snippet_text">Get a customization</h2>
+					<p class="o_default_snippet_text">
+						We can also adapt this app to meats your expectations. Send us an email to define what you need.
+					</p>
+					<div class="s_btn text-left pt16 pb16">
+						<a href="https://odoo.bhc.be/page/contact" class="btn btn-primary o_default_snippet_text">Contact Us</a>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+	<div class="tab-pane" id="pills-apps" role="tabpanel" aria-labelledby="pills-apps-tab">
+		<div class="container">
+			<div class="row align-items-center">
+				<div class="col-lg-6 pt16 pb16">
+					<h2 class="o_default_snippet_text">Ingram Gateway</h2>
+					<p class="o_default_snippet_text">
+						Import Pricelists and availability of Ingram products.
+					</p>
+					<div class="s_btn text-left pt16 pb16" data-name="Buttons">
+						<a href="https://www.odoo.com/apps/modules/10.0/Ingram/" class="btn btn-primary o_default_snippet_text">Discover more</a>
+					</div>
+				</div>
+				<div class="col-lg-6 pt16 pb16">
+					<img src="ingram.png" class="img img-fluid mx-auto" alt="Ingram" data-original-title="" title="">
+				</div>
+			</div>
+		</div>
+		<div class="container">
+			<div class="row align-items-center">
+				<div class="col-lg-6 pt16 pb16">
+					<img src="litigation.png" class="img img-fluid mx-auto" alt="Litigation">
+				</div>
+				<div class="col-lg-6 pt16 pb16">
+					<h2 class="o_default_snippet_text">Litigation Management</h2>
+					<p class="o_default_snippet_text">
+						Create and manage your litigation in one specific app.
+					</p>
+					<div class="s_btn text-left pt16 pb16">
+						<a href="https://www.odoo.com/apps/modules/11.0/litigation/" class="btn btn-primary o_default_snippet_text">Discover more</a>
+					</div>
+				</div>
+			</div>
+		</div>
+		<div class="container">
+			<div class="row align-items-center">
+				<div class="col-lg-6 pt16 pb16">
+					<h2 class="o_default_snippet_text">Sales Taxes Summary</h2>
+					<p class="o_default_snippet_text">
+						Compute taxes on sales quotations and orders.
+					</p>
+					<div class="s_btn text-left pt16 pb16" data-name="Buttons">
+					<a href="https://www.odoo.com/apps/modules/10.0/sales_taxes_summary/" class="btn btn-primary o_default_snippet_text">Discover more</a>
+					</div>
+				</div>
+				<div class="col-lg-6 pt16 pb16">
+					<img src="sales_taxes_summary.png" class="img img-fluid mx-auto" alt="SalesTaxesSummary" data-original-title="" title="">
+				</div>
+			</div>
+		</div>
+	</div>
+</div>

TEMPAT SAMPAH
static/description/ingram.png


TEMPAT SAMPAH
static/description/litigation.png


TEMPAT SAMPAH
static/description/map.png


TEMPAT SAMPAH
static/description/sales_taxes_summary.png


+ 19 - 0
views/res_partner_view.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="view_partner_form_inh09052019">
+            <field name="name">res.partner.form.inh</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_partner_form"/>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <field name="street" position="before">
+                    <button name="open_map" string="Map" type="object" class="oe_link or_right"/>
+                </field>
+                <!-- <xpath expr="/form/sheet/notebook/page/field[@name='child_ids']/form/sheet/group/group/div/div[@name='div_address']/field[@name='street']" position="before">
+                    <button name="open_map" string="Map" type="object" class="oe_link or_right" />
+                </xpath>  -->
+            </field>
+        </record>
+    </data>
+</openerp>