simple version of google maps directions

develop
Andreas Osim 2019-04-05 08:40:24 +02:00
parent 220acfd627
commit 10883474d3
8 changed files with 124 additions and 0 deletions

View File

@ -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.

View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import models
from . import wizards

View File

@ -0,0 +1,19 @@
# 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 RouteMaps',
'summary' : 'very simple google maps route planner',
'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': [
'wizards/wizard_routemaps.xml',
],
'installable': True,
'auto_install': False,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

View File

@ -0,0 +1 @@
from . import wizard_routemaps

View File

@ -0,0 +1,36 @@
# Copyright 2018-Today datenpol gmbh (<http://www.datenpol.at>)
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class WizardRouteMaps(models.TransientModel):
_name = 'wizard.routemaps'
_description = 'Routenplaner'
name = fields.Char()
@api.multi
def button_routemaps(self):
home_address = r'Neugasse 36, 2244 Spannberg'
for wizard in self:
active_ids = self.env.context.get('active_ids', [])
sale_orders = self.env['sale.order'].browse(active_ids)
if sale_orders.exists():
address = ""
sid = set()
for so in sale_orders:
if (so.partner_shipping_id.id not in sid):
sid.add(so.partner_shipping_id.id)
address += "/"+so.partner_shipping_id.street+","+so.partner_shipping_id.zip+","+so.partner_shipping_id.city+","+so.partner_shipping_id.country_id.name
gomaps_link = "https://www.google.at/maps/dir/"+home_address+address
# action = self.env.ref('sale.action_orders').read()[0]
# action['domain'] = [('id', 'in', active_ids)]
# return action
return {
'type': 'ir.actions.act_url',
'url': '%s' % gomaps_link,
'view_mode':'form'
}

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018-Today datenpol gmbh(<http://www.datenpol.at>)
License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). -->
<odoo>
<record id="view_wizard_routmaps_form" model="ir.ui.view">
<field name="name">view_wizard_routemaps_form</field>
<field name="model">wizard.routemaps</field>
<field name="arch" type="xml">
<form string="Wizard Route Maps">
<group>
<p>Wollen Sie für die markierten Aufträge eine Route planen?</p>
</group>
<footer>
<button name="button_routemaps"
string="Route Planen"
class="btn-primary"
type="object"/>
<button string="Abbrechen"
class="btn-default"
special="cancel"/>
</footer>
</form>
</field>
</record>
<act_window id="action_wizard_routemaps"
name="Routenplaner"
src_model="sale.order"
res_model="wizard.routemaps"
view_type="form"
view_mode="form"
key2="client_action_multi"
target="new"/>
</odoo>