Browse Source

Port partner_external_map to v10

Remove Yahoo Maps
Update URLs for MapQuest
pull/505/head
Alexis de Lattre 8 years ago
committed by Pedro M. Baeza
parent
commit
a6fba13130
  1. 17
      partner_external_map/README.rst
  2. 6
      partner_external_map/__manifest__.py
  3. 19
      partner_external_map/data/map_website_data.xml
  4. 2
      partner_external_map/hooks.py
  5. 4
      partner_external_map/models/map_website.py
  6. 6
      partner_external_map/models/res_partner.py
  7. 4
      partner_external_map/models/res_users.py
  8. 4
      partner_external_map/tests/test_partner_external_map.py
  9. 20
      partner_external_map/views/map_website_view.xml
  10. 13
      partner_external_map/views/res_partner_view.xml
  11. 11
      partner_external_map/views/res_users_view.xml

17
partner_external_map/README.rst

@ -26,7 +26,6 @@ This module supports several map websites:
* `Bing Maps <https://www.bing.com/maps/>` * `Bing Maps <https://www.bing.com/maps/>`
* `Here Maps <https://www.here.com/>` * `Here Maps <https://www.here.com/>`
* `MapQuest <http://www.mapquest.com/>` * `MapQuest <http://www.mapquest.com/>`
* `Yahoo! Maps <https://maps.yahoo.com/>`
If the module *base_geolocalize* from the official addons is installed on the 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 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 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 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. pre-configured map websites.
Usage Usage
@ -55,7 +54,7 @@ or a route map.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :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 Known issues / Roadmap
====================== ======================
@ -69,11 +68,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues Bugs are tracked on `GitHub Issues
<https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please <https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first, 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
<https://github.com/OCA/
partner-contact/issues/new?body=module:%20
partner_external_map%0Aversion:%20
9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
help us smashing it by providing a detailed and welcomed feedback.
Credits Credits
======= =======
@ -87,9 +82,9 @@ Contributors
Maintainer Maintainer
---------- ----------
.. image:: http://odoo-community.org/logo.png
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association :alt: Odoo Community Association
:target: http://odoo-community.org
:target: https://odoo-community.org
This module is maintained by the OCA. This module is maintained by the OCA.

6
partner_external_map/__manifest__.py

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Alexis de Lattre <alexis.delattre@akretion.com>
# © 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'Partner External Maps', 'name': 'Partner External Maps',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'category': 'Extra Tools', 'category': 'Extra Tools',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Add Map and Map Routing buttons on partner form to ' 'summary': 'Add Map and Map Routing buttons on partner form to '
@ -23,5 +23,5 @@
'security/ir.model.access.csv', 'security/ir.model.access.csv',
], ],
'post_init_hook': 'set_default_map_settings', 'post_init_hook': 'set_default_map_settings',
'installable': False,
'installable': True,
} }

19
partner_external_map/data/map_website_data.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Alexis de Lattre <alexis.delattre@akretion.com>
<!-- © 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
<odoo> <odoo>
@ -42,17 +42,14 @@
<record id="mapquest" model="map.website"> <record id="mapquest" model="map.website">
<field name="name">MapQuest</field> <field name="name">MapQuest</field>
<field name="address_url">http://mapq.st/?q={ADDRESS}</field>
<field name="lat_lon_url">http://mapq.st/?q={LATITUDE},{LONGITUDE}</field>
<field name="route_address_url">http://mapq.st/directions?saddr={START_ADDRESS}&amp;daddr={DEST_ADDRESS}</field>
<field name="route_lat_lon_url">http://mapq.st/directions?saddr={START_LATITUDE},{START_LONGITUDE}&amp;daddr={DEST_LATITUDE},{DEST_LONGITUDE}</field>
<field name="address_url">https://www.mapquest.com/?center={ADDRESS}</field>
<field name="lat_lon_url">https://www.mapquest.com/?center={LATITUDE},{LONGITUDE}</field>
<field name="route_address_url">https://www.mapquest.com/directions?q1={START_ADDRESS}&amp;q2={DEST_ADDRESS}</field>
<field name="route_lat_lon_url">https://www.mapquest.com/directions/from/near-{START_LATITUDE},{START_LONGITUDE}/to/near-{DEST_LATITUDE},{DEST_LONGITUDE}</field>
</record> </record>
<record id="yahoo_maps" model="map.website">
<field name="name">Yahoo! Maps</field>
<field name="address_url">https://maps.yahoo.com/place/?addr={ADDRESS}</field>
<field name="lat_lon_url">https://maps.yahoo.com/place/?lat={LATITUDE}&amp;lon={LONGITUDE}</field>
<field name="route_address_url">https://maps.yahoo.com/directions/?o={START_ADDRESS}&amp;d={DEST_ADDRESS}</field>
</record>
<!-- On June 4, 2015, Yahoo! announced that Yahoo! Maps would be shut down
https://www.cnet.com/news/yahoo-to-shut-down-its-maps-site/
-->
</odoo> </odoo>

2
partner_external_map/hooks.py

@ -3,7 +3,7 @@
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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 import logging

4
partner_external_map/models/map_website.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Alexis de Lattre <alexis.delattre@akretion.com>
# © 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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): class MapWebsite(models.Model):

6
partner_external_map/models/res_partner.py

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Alexis de Lattre <alexis.delattre@akretion.com>
# © 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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 import logging

4
partner_external_map/models/res_users.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2015 Alexis de Lattre <alexis.delattre@akretion.com>
# © 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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 import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

4
partner_external_map/tests/test_partner_external_map.py

@ -2,8 +2,8 @@
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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 from ..hooks import set_default_map_settings

20
partner_external_map/views/map_website_view.xml

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2015 Akretion France (www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
<openerp>
<data>
<odoo>
<record id="map_website_form" model="ir.ui.view"> <record id="map_website_form" model="ir.ui.view">
<field name="name">map.website.form</field> <field name="name">map.website.form</field>
@ -41,9 +39,13 @@
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
</record> </record>
<!-- Menu entry under Sales > Config > Address Book > Localization -->
<!-- Menu entry under Settings > Technical
We prefered the menu entry of previous Odoo versions under
Sales > Config > Address Book > Localization, but in v10 that
would required a dependency on sales_team, and we don't want that -->
<menuitem id="root_map_website_menu" name="Map Websites" parent="base.menu_custom" sequence="100"/>
<menuitem id="map_website_menu" action="map_website_action" <menuitem id="map_website_menu" action="map_website_action"
parent="base.menu_localisation" sequence="50"/>
parent="root_map_website_menu"/>
</data>
</openerp>
</odoo>

13
partner_external_map/views/res_partner_view.xml

@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2015 Akretion France (www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
<openerp>
<data>
<odoo>
<!-- Inherit partner view to add 'Map' button -->
<!-- Inherit partner view to add 'Map' and 'Route Map' buttons -->
<record id="view_partner_form" model="ir.ui.view"> <record id="view_partner_form" model="ir.ui.view">
<field name="name">map.button.res.partner.form</field> <field name="name">map.button.res.partner.form</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>
@ -27,5 +25,4 @@
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>

11
partner_external_map/views/res_users_view.xml

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2015 Akretion France (www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
<openerp>
<data>
<odoo>
<record id="view_users_form" model="ir.ui.view"> <record id="view_users_form" model="ir.ui.view">
<field name="name">map.res.users.form</field> <field name="name">map.res.users.form</field>
@ -38,5 +36,4 @@
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save