very simple Goggle Maps integration
parent
e4caee7570
commit
315b6125d1
|
|
@ -0,0 +1,27 @@
|
|||
Odoo Proprietary License v1.0
|
||||
|
||||
This software and associated files (the "Software") may only be used (executed,
|
||||
modified, executed after modifications) if you have purchased a valid license
|
||||
from the authors, typically via Odoo Apps, or if you have received a written
|
||||
agreement from the authors of the Software (see the COPYRIGHT file).
|
||||
|
||||
You may develop Odoo modules that use the Software as a library (typically by
|
||||
depending on it, importing it and using its resources), but without copying any
|
||||
source code or material from the Software. You may distribute those modules
|
||||
under the license of your choice, provided that this license is compatible with
|
||||
the terms of the Odoo Proprietary License (For example: LGPL, MIT,
|
||||
or proprietary licenses similar to this one).
|
||||
|
||||
It is forbidden to publish, distribute, sublicense, or sell copies of the Software
|
||||
or modified copies of the Software.
|
||||
|
||||
The above copyright notice and this permission notice must be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# Copyright 2018-Today TZAustria
|
||||
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
|
||||
|
||||
# noinspection PyStatementEffect
|
||||
{
|
||||
'name': 'TZ goMaps',
|
||||
'summary' : 'very simple google maps integration',
|
||||
'version': '11.0.1.0.0',
|
||||
'license': 'OPL-1',
|
||||
'author': 'TZAustria',
|
||||
'support': 'andreas.osim@glaser-co.at',
|
||||
'website': 'https://www.tzaustria.at',
|
||||
'depends': ['base','account'],
|
||||
'data': ['views/res_partner_views.xml'],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
class TZgoMaps(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
@api.multi
|
||||
def goMaps(self):
|
||||
for record in self:
|
||||
street = record.street+',' if record.street else ''
|
||||
zip = record.zip+',' if record.zip else ''
|
||||
city = record.city+',' if record.city else ''
|
||||
country_code = record.country_id.code+',' if record.country_id.code else ''
|
||||
gomaps_link = 'https://www.google.at/maps/place/'+street.replace('/','.')+zip+city+country_code
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'url': '%s' % gomaps_link,
|
||||
'view_mode':'form'
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import TZgMaps
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 361 KiB |
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_partner_form" model="ir.ui.view">
|
||||
<field name="name">view_partner_form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="button_box" position="inside">
|
||||
<button type="object" name="goMaps" class="oe_stat_button" icon='fa-globe' string="goMaps"/>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Loading…
Reference in New Issue