diff --git a/ext/custom-addons/tz_routemaps/LICENSE b/ext/custom-addons/tz_routemaps/LICENSE new file mode 100644 index 00000000..272c64b8 --- /dev/null +++ b/ext/custom-addons/tz_routemaps/LICENSE @@ -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. diff --git a/ext/custom-addons/tz_routemaps/__init__.py b/ext/custom-addons/tz_routemaps/__init__.py new file mode 100644 index 00000000..f553d8ff --- /dev/null +++ b/ext/custom-addons/tz_routemaps/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import models +from . import wizards diff --git a/ext/custom-addons/tz_routemaps/__manifest__.py b/ext/custom-addons/tz_routemaps/__manifest__.py new file mode 100644 index 00000000..7e7e1415 --- /dev/null +++ b/ext/custom-addons/tz_routemaps/__manifest__.py @@ -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, +} diff --git a/ext/custom-addons/tz_routemaps/static/description/icon.png b/ext/custom-addons/tz_routemaps/static/description/icon.png new file mode 100644 index 00000000..32c1481d Binary files /dev/null and b/ext/custom-addons/tz_routemaps/static/description/icon.png differ diff --git a/ext/custom-addons/tz_routemaps/static/src/img/favicon.ico b/ext/custom-addons/tz_routemaps/static/src/img/favicon.ico new file mode 100644 index 00000000..90f1e91c Binary files /dev/null and b/ext/custom-addons/tz_routemaps/static/src/img/favicon.ico differ diff --git a/ext/custom-addons/tz_routemaps/wizards/__init__.py b/ext/custom-addons/tz_routemaps/wizards/__init__.py new file mode 100644 index 00000000..5b7adc3c --- /dev/null +++ b/ext/custom-addons/tz_routemaps/wizards/__init__.py @@ -0,0 +1 @@ +from . import wizard_routemaps \ No newline at end of file diff --git a/ext/custom-addons/tz_routemaps/wizards/wizard_routemaps.py b/ext/custom-addons/tz_routemaps/wizards/wizard_routemaps.py new file mode 100644 index 00000000..a4474965 --- /dev/null +++ b/ext/custom-addons/tz_routemaps/wizards/wizard_routemaps.py @@ -0,0 +1,36 @@ +# Copyright 2018-Today datenpol gmbh () +# 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' + } diff --git a/ext/custom-addons/tz_routemaps/wizards/wizard_routemaps.xml b/ext/custom-addons/tz_routemaps/wizards/wizard_routemaps.xml new file mode 100644 index 00000000..aed5fad8 --- /dev/null +++ b/ext/custom-addons/tz_routemaps/wizards/wizard_routemaps.xml @@ -0,0 +1,37 @@ + + + + + + + view_wizard_routemaps_form + wizard.routemaps + +
+ +

Wollen Sie für die markierten Aufträge eine Route planen?

+
+
+
+
+
+
+ + + +