From e0141000b58c241704bce901ea5bc10fef9e5a3e Mon Sep 17 00:00:00 2001 From: agaldona Date: Tue, 14 Nov 2017 13:22:44 +0100 Subject: [PATCH] [MIG] base_location_nuts: Migration to 11.0 --- base_location_nuts/README.rst | 3 ++- base_location_nuts/__init__.py | 2 -- base_location_nuts/__manifest__.py | 7 +++---- base_location_nuts/models/__init__.py | 2 -- base_location_nuts/models/res_country.py | 1 - base_location_nuts/models/res_partner.py | 1 - base_location_nuts/models/res_partner_nuts.py | 2 -- base_location_nuts/tests/__init__.py | 2 -- .../tests/test_base_location_nuts.py | 1 - .../views/res_partner_nuts_view.xml | 2 +- base_location_nuts/wizard/__init__.py | 2 -- base_location_nuts/wizard/nuts_import.py | 18 +++++++++--------- base_location_nuts/wizard/nuts_import_view.xml | 4 +--- 13 files changed, 16 insertions(+), 31 deletions(-) diff --git a/base_location_nuts/README.rst b/base_location_nuts/README.rst index 38104a5e193..26215f8707b 100644 --- a/base_location_nuts/README.rst +++ b/base_location_nuts/README.rst @@ -1,4 +1,5 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl :alt: License: AGPL-3 ============ @@ -48,7 +49,7 @@ in order to allow to assign them to partner object. .. 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/10.0 + :target: https://runbot.odoo-community.org/runbot/134/11.0 Bug Tracker =========== diff --git a/base_location_nuts/__init__.py b/base_location_nuts/__init__.py index 35e7c9600c5..9b4296142f4 100644 --- a/base_location_nuts/__init__.py +++ b/base_location_nuts/__init__.py @@ -1,4 +1,2 @@ -# -*- coding: utf-8 -*- - from . import models from . import wizard diff --git a/base_location_nuts/__manifest__.py b/base_location_nuts/__manifest__.py index 1396bf5200f..dfe8ccedbd1 100644 --- a/base_location_nuts/__manifest__.py +++ b/base_location_nuts/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Antonio Espinosa # Copyright 2016 Jairo Llopis # Copyright 2017 David Vidal @@ -7,9 +6,9 @@ { 'name': 'NUTS Regions', 'category': 'Localisation/Europe', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'depends': [ - 'sales_team', + 'contacts', ], 'data': [ 'views/res_country_view.xml', @@ -23,7 +22,7 @@ ], 'author': 'Tecnativa, ' 'Odoo Community Association (OCA)', - 'website': 'https://www.tecnativa.com', + 'website': 'https://github.com/OCA/partner-contact/', 'license': 'AGPL-3', 'installable': True, } diff --git a/base_location_nuts/models/__init__.py b/base_location_nuts/models/__init__.py index 9f362acc6ff..3adc67d7479 100644 --- a/base_location_nuts/models/__init__.py +++ b/base_location_nuts/models/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from . import res_country from . import res_partner from . import res_partner_nuts diff --git a/base_location_nuts/models/res_country.py b/base_location_nuts/models/res_country.py index 677c8086d3f..c06850e517c 100644 --- a/base_location_nuts/models/res_country.py +++ b/base_location_nuts/models/res_country.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Antonio Espinosa # Copyright 2016 Jairo Llopis # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/base_location_nuts/models/res_partner.py b/base_location_nuts/models/res_partner.py index a623a37f634..9524c3a753f 100644 --- a/base_location_nuts/models/res_partner.py +++ b/base_location_nuts/models/res_partner.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Antonio Espinosa # Copyright 2016 Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/base_location_nuts/models/res_partner_nuts.py b/base_location_nuts/models/res_partner_nuts.py index b61da031300..25e23293738 100644 --- a/base_location_nuts/models/res_partner_nuts.py +++ b/base_location_nuts/models/res_partner_nuts.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# -*- coding: utf-8 -*- # Copyright 2015 Antonio Espinosa # Copyright 2016 Jairo Llopis # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/base_location_nuts/tests/__init__.py b/base_location_nuts/tests/__init__.py index d04b777eb9e..8399f6d431e 100644 --- a/base_location_nuts/tests/__init__.py +++ b/base_location_nuts/tests/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import test_base_location_nuts diff --git a/base_location_nuts/tests/test_base_location_nuts.py b/base_location_nuts/tests/test_base_location_nuts.py index f523d8412c9..6c1d68e0bb8 100644 --- a/base_location_nuts/tests/test_base_location_nuts.py +++ b/base_location_nuts/tests/test_base_location_nuts.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/base_location_nuts/views/res_partner_nuts_view.xml b/base_location_nuts/views/res_partner_nuts_view.xml index 610a6c2457c..3e1c5642389 100644 --- a/base_location_nuts/views/res_partner_nuts_view.xml +++ b/base_location_nuts/views/res_partner_nuts_view.xml @@ -68,7 +68,7 @@ diff --git a/base_location_nuts/wizard/__init__.py b/base_location_nuts/wizard/__init__.py index b5a60faa369..d6a5945e6b1 100644 --- a/base_location_nuts/wizard/__init__.py +++ b/base_location_nuts/wizard/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import nuts_import diff --git a/base_location_nuts/wizard/nuts_import.py b/base_location_nuts/wizard/nuts_import.py index ddca652ec8a..c756b625776 100644 --- a/base_location_nuts/wizard/nuts_import.py +++ b/base_location_nuts/wizard/nuts_import.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Antonio Espinosa # Copyright 2016 Jairo Llopis # Copyright 2017 David Vidal @@ -79,7 +78,7 @@ def _check_node(self, node): def _mapping(self, node): item = {} - for k, v in self._map.iteritems(): + for k, v in self._map.items(): field_xpath = v.get('xpath', '') field_attrib = v.get('attrib', False) field_type = v.get('type', 'string') @@ -118,11 +117,11 @@ def _download_nuts(self, url_base=None, url_path=None, url_params=None): if not url_params: url_params = URL_PARAMS url = url_base + url_path + '?' - url += '&'.join([k + '=' + v for k, v in url_params.iteritems()]) + url += '&'.join([k + '=' + v for k, v in url_params.items()]) logger.info('Starting to download %s' % url) try: res_request = requests.get(url) - except Exception, e: + except Exception as e: raise UserError( _('Got an error when trying to download the file: %s.') % str(e)) @@ -133,15 +132,15 @@ def _download_nuts(self, url_base=None, url_path=None, url_params=None): logger.info('Download successfully %d bytes' % len(res_request.content)) # Workaround XML: Remove all characters before Import NUTS 2013 from RAMON - You can import NUTS from RAMON european service. 20 - automatic