From 355d6fa44ae1df32b7b381843b0a7051cd6493a4 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 22 Oct 2016 23:50:46 +0200 Subject: [PATCH] Port partner_external_map to v10 Remove Yahoo Maps Update URLs for MapQuest --- partner_external_map/README.rst | 17 ++++++---------- partner_external_map/__manifest__.py | 6 +++--- .../data/map_website_data.xml | 19 ++++++++---------- partner_external_map/hooks.py | 2 +- partner_external_map/models/map_website.py | 4 ++-- partner_external_map/models/res_partner.py | 6 +++--- partner_external_map/models/res_users.py | 4 ++-- .../tests/test_partner_external_map.py | 4 ++-- .../views/map_website_view.xml | 20 ++++++++++--------- .../views/res_partner_view.xml | 13 +++++------- partner_external_map/views/res_users_view.xml | 11 ++++------ 11 files changed, 47 insertions(+), 59 deletions(-) diff --git a/partner_external_map/README.rst b/partner_external_map/README.rst index 48951bc39..0d1af0086 100644 --- a/partner_external_map/README.rst +++ b/partner_external_map/README.rst @@ -26,7 +26,6 @@ This module supports several map websites: * `Bing Maps ` * `Here Maps ` * `MapQuest ` -* `Yahoo! Maps ` If the module *base_geolocalize* from the official addons is installed on the system, it will use the latitude and longitude to localize the partner (instead @@ -36,9 +35,9 @@ Configuration ============= If you want to create additionnal map websites, go to the menu -*Sales > Configuration > Address Book > Localization > Map Websites*. You are +*Settings > Technical > Map Websites > Map Websites*. You are invited to send the configuration information of your additionnal map websites -to the author of the module, so that the module can be updated with more +to one of the authors of the module, so that the module can be updated with more pre-configured map websites. Usage @@ -55,7 +54,7 @@ or a route map. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/134/9.0 + :target: https://runbot.odoo-community.org/runbot/134/10.0 Known issues / Roadmap ====================== @@ -69,11 +68,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed `feedback -`_. +help us smashing it by providing a detailed and welcomed feedback. Credits ======= @@ -87,9 +82,9 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. diff --git a/partner_external_map/__manifest__.py b/partner_external_map/__manifest__.py index 3bfa6e216..85c6f4968 100644 --- a/partner_external_map/__manifest__.py +++ b/partner_external_map/__manifest__.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -# © 2015 Alexis de Lattre +# © 2015-2016 Akretion (Alexis de Lattre ) # © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Partner External Maps', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Extra Tools', 'license': 'AGPL-3', 'summary': 'Add Map and Map Routing buttons on partner form to ' @@ -23,5 +23,5 @@ 'security/ir.model.access.csv', ], 'post_init_hook': 'set_default_map_settings', - 'installable': False, + 'installable': True, } diff --git a/partner_external_map/data/map_website_data.xml b/partner_external_map/data/map_website_data.xml index 353b1e6e8..52c20a67f 100644 --- a/partner_external_map/data/map_website_data.xml +++ b/partner_external_map/data/map_website_data.xml @@ -1,5 +1,5 @@ - @@ -42,17 +42,14 @@ MapQuest - http://mapq.st/?q={ADDRESS} - http://mapq.st/?q={LATITUDE},{LONGITUDE} - http://mapq.st/directions?saddr={START_ADDRESS}&daddr={DEST_ADDRESS} - http://mapq.st/directions?saddr={START_LATITUDE},{START_LONGITUDE}&daddr={DEST_LATITUDE},{DEST_LONGITUDE} + https://www.mapquest.com/?center={ADDRESS} + https://www.mapquest.com/?center={LATITUDE},{LONGITUDE} + https://www.mapquest.com/directions?q1={START_ADDRESS}&q2={DEST_ADDRESS} + https://www.mapquest.com/directions/from/near-{START_LATITUDE},{START_LONGITUDE}/to/near-{DEST_LATITUDE},{DEST_LONGITUDE} - - Yahoo! Maps - https://maps.yahoo.com/place/?addr={ADDRESS} - https://maps.yahoo.com/place/?lat={LATITUDE}&lon={LONGITUDE} - https://maps.yahoo.com/directions/?o={START_ADDRESS}&d={DEST_ADDRESS} - + diff --git a/partner_external_map/hooks.py b/partner_external_map/hooks.py index 93e4e4530..a66e504b0 100644 --- a/partner_external_map/hooks.py +++ b/partner_external_map/hooks.py @@ -3,7 +3,7 @@ # © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import api, SUPERUSER_ID +from odoo import api, SUPERUSER_ID import logging diff --git a/partner_external_map/models/map_website.py b/partner_external_map/models/map_website.py index fa3cd75a2..f8befdfca 100644 --- a/partner_external_map/models/map_website.py +++ b/partner_external_map/models/map_website.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# © 2015 Alexis de Lattre +# © 2015-2016 Akretion (Alexis de Lattre ) # © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields class MapWebsite(models.Model): diff --git a/partner_external_map/models/res_partner.py b/partner_external_map/models/res_partner.py index 3e038a7e7..22ee85bce 100644 --- a/partner_external_map/models/res_partner.py +++ b/partner_external_map/models/res_partner.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# © 2015 Alexis de Lattre +# © 2015-2016 Akretion (Alexis de Lattre ) # © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, api, _ -from openerp.exceptions import Warning as UserError +from odoo import models, api, _ +from odoo.exceptions import UserError import logging diff --git a/partner_external_map/models/res_users.py b/partner_external_map/models/res_users.py index 9a8587f6f..cf4a3136d 100644 --- a/partner_external_map/models/res_users.py +++ b/partner_external_map/models/res_users.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# © 2015 Alexis de Lattre +# © 2015-2016 Akretion (Alexis de Lattre ) # © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from odoo import models, fields, api import logging logger = logging.getLogger(__name__) diff --git a/partner_external_map/tests/test_partner_external_map.py b/partner_external_map/tests/test_partner_external_map.py index 2151b51bc..6cb8c1d1d 100644 --- a/partner_external_map/tests/test_partner_external_map.py +++ b/partner_external_map/tests/test_partner_external_map.py @@ -2,8 +2,8 @@ # © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.tests import common -from openerp.exceptions import Warning as UserError +from odoo.tests import common +from odoo.exceptions import UserError from ..hooks import set_default_map_settings diff --git a/partner_external_map/views/map_website_view.xml b/partner_external_map/views/map_website_view.xml index 89079a825..543b87b73 100644 --- a/partner_external_map/views/map_website_view.xml +++ b/partner_external_map/views/map_website_view.xml @@ -1,12 +1,10 @@ - - + map.website.form @@ -41,9 +39,13 @@ tree,form - + + + + parent="root_map_website_menu"/> - - + diff --git a/partner_external_map/views/res_partner_view.xml b/partner_external_map/views/res_partner_view.xml index 55f578d8a..9b367bb18 100644 --- a/partner_external_map/views/res_partner_view.xml +++ b/partner_external_map/views/res_partner_view.xml @@ -1,14 +1,12 @@ - - + - + map.button.res.partner.form res.partner @@ -27,5 +25,4 @@ - - + diff --git a/partner_external_map/views/res_users_view.xml b/partner_external_map/views/res_users_view.xml index 38847127a..013d2b0f3 100644 --- a/partner_external_map/views/res_users_view.xml +++ b/partner_external_map/views/res_users_view.xml @@ -1,12 +1,10 @@ - - + map.res.users.form @@ -38,5 +36,4 @@ - - +