From 3a965f3552daaa0c023868c70e25a5443053b61e Mon Sep 17 00:00:00 2001 From: Francesco Apruzzese Date: Wed, 19 Oct 2016 10:57:33 +0200 Subject: [PATCH] [MIG] base_location: Migrated to 10.0 * Headers shortened * Move cities management to settings --- base_location/README.rst | 5 +- base_location/__init__.py | 23 +--- base_location/__openerp__.py | 40 ++----- base_location/models/__init__.py | 6 +- base_location/models/better_zip.py | 25 +---- base_location/models/company.py | 28 +---- base_location/models/partner.py | 27 +---- base_location/models/state.py | 26 +---- base_location/tests/__init__.py | 5 +- base_location/tests/test_completion.py | 7 +- base_location/views/better_zip_view.xml | 130 ++++++++++++----------- base_location/views/company_view.xml | 32 +++--- base_location/views/partner_view.xml | 42 ++++---- base_location/views/res_country_view.xml | 26 +++-- base_location/views/state_view.xml | 46 ++++---- 15 files changed, 174 insertions(+), 294 deletions(-) diff --git a/base_location/README.rst b/base_location/README.rst index d3434c556..9cafe8b0c 100644 --- a/base_location/README.rst +++ b/base_location/README.rst @@ -17,7 +17,7 @@ Usage .. 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 Bug Tracker =========== @@ -28,7 +28,7 @@ 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 `here `_. +10.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Credits ======= @@ -42,6 +42,7 @@ Contributors * Alejandro Santana * Sandy Carter * Yannick Vaucher +* Francesco Apruzzese Icon ---- diff --git a/base_location/__init__.py b/base_location/__init__.py index bb01c93ee..a5fc6a4d0 100644 --- a/base_location/__init__.py +++ b/base_location/__init__.py @@ -1,24 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi. Copyright Camptocamp SA -# Contributor: Pedro Manuel Baeza -# Ignacio Ibeas -# Alejandro Santana -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2016 Nicolas Bessi, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/base_location/__openerp__.py b/base_location/__openerp__.py index b987141b9..969b89308 100644 --- a/base_location/__openerp__.py +++ b/base_location/__openerp__.py @@ -1,43 +1,19 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi. Copyright Camptocamp SA -# Contributor: Pedro Manuel Baeza -# Ignacio Ibeas -# Alejandro Santana -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright 2016 Nicolas Bessi, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + { 'name': 'Location management (aka Better ZIP)', - 'version': '9.0.1.0.0', - 'depends': ['base'], + 'version': '10.0.1.0.0', + 'depends': [ + 'base', + ], 'author': "Camptocamp," "ACYSOS S.L.," "Alejandro Santana," - "Serv. Tecnol. Avanzados - Pedro M. Baeza," + "Tecnativa," "Odoo Community Association (OCA)", 'license': "AGPL-3", - 'contributors': [ - 'Nicolas Bessi ', - 'Pedro M. Baeza ', - 'Ignacio Ibeas (Acysos S.L.)', - 'Alejandro Santana ', - 'Sandy Carter ', - 'Yannick Vaucher ', - ], 'summary': '''Enhanced zip/npa management system''', 'website': 'http://www.camptocamp.com', 'data': ['views/better_zip_view.xml', diff --git a/base_location/models/__init__.py b/base_location/models/__init__.py index 351a33ad1..3d1df1e8d 100644 --- a/base_location/models/__init__.py +++ b/base_location/models/__init__.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- -# -# License, author and contributors information in: -# __openerp__.py file at the root folder of this module. -# +# Copyright 2016 Nicolas Bessi, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import better_zip from . import partner diff --git a/base_location/models/better_zip.py b/base_location/models/better_zip.py index 7790d9ff7..c85ea78ae 100644 --- a/base_location/models/better_zip.py +++ b/base_location/models/better_zip.py @@ -1,25 +1,8 @@ # -*- coding: utf-8 -*- -# -# -# Author: Nicolas Bessi. Copyright Camptocamp SA -# Contributor: Pedro Manuel Baeza -# Ignacio Ibeas -# Alejandro Santana -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -from openerp import models, fields, api +# Copyright 2016 Nicolas Bessi, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api class BetterZip(models.Model): diff --git a/base_location/models/company.py b/base_location/models/company.py index 6368761cf..d1970d2ae 100644 --- a/base_location/models/company.py +++ b/base_location/models/company.py @@ -1,33 +1,14 @@ # -*- coding: utf-8 -*- -# -# -# Author: Nicolas Bessi. Copyright Camptocamp SA -# Contributor: Pedro Manuel Baeza -# Ignacio Ibeas -# Alejandro Santana -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# -from openerp import models, fields, api +# Copyright 2016 Nicolas Bessi, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api class ResCompany(models.Model): _inherit = 'res.company' - @api.one @api.onchange('better_zip_id') def on_change_city(self): if self.better_zip_id: @@ -39,6 +20,5 @@ class ResCompany(models.Model): better_zip_id = fields.Many2one( 'res.better.zip', string='Location', - select=1, help='Use the city name or the zip code to search the location', ) diff --git a/base_location/models/partner.py b/base_location/models/partner.py index c16ae83b1..1eaa08cf3 100644 --- a/base_location/models/partner.py +++ b/base_location/models/partner.py @@ -1,33 +1,14 @@ # -*- coding: utf-8 -*- -# -# -# Author: Nicolas Bessi. Copyright Camptocamp SA -# Contributor: Pedro Manuel Baeza -# Ignacio Ibeas -# Alejandro Santana -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# -from openerp import models, fields, api +# Copyright 2016 Nicolas Bessi, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api class ResPartner(models.Model): _inherit = 'res.partner' zip_id = fields.Many2one('res.better.zip', 'City/Location') - @api.one @api.onchange('zip_id') def onchange_zip_id(self): if self.zip_id: diff --git a/base_location/models/state.py b/base_location/models/state.py index d9db12e50..5c3b31f60 100644 --- a/base_location/models/state.py +++ b/base_location/models/state.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -# -# -# Author: Nicolas Bessi. Copyright Camptocamp SA -# Contributor: Pedro Manuel Baeza -# Ignacio Ibeas -# Alejandro Santana -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# -from openerp import models, fields +# Copyright 2016 Nicolas Bessi, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields class ResCountryState(models.Model): diff --git a/base_location/tests/__init__.py b/base_location/tests/__init__.py index 78c6dfa4c..3c8d5b3d9 100644 --- a/base_location/tests/__init__.py +++ b/base_location/tests/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- -# © 2015 Yannick Vaucher (Camptocamp) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# Copyright 2015 Yannick Vaucher, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import test_completion diff --git a/base_location/tests/test_completion.py b/base_location/tests/test_completion.py index 30ea0a743..cf75c05f3 100644 --- a/base_location/tests/test_completion.py +++ b/base_location/tests/test_completion.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- -# © 2015 Yannick Vaucher (Camptocamp) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -"""Test a city completion and onchanges.""" +# Copyright 2015 Yannick Vaucher, Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.tests.common import TransactionCase +from odoo.tests.common import TransactionCase class TestCompletion(TransactionCase): diff --git a/base_location/views/better_zip_view.xml b/base_location/views/better_zip_view.xml index cfe13bc52..d384c7d8e 100644 --- a/base_location/views/better_zip_view.xml +++ b/base_location/views/better_zip_view.xml @@ -1,70 +1,74 @@ - - + - - res.better.zip.form - res.better.zip - -
- - - - - - - -
-
-
+ + res.better.zip.form + res.better.zip + +
+ + + + + + + +
+
+
+ + + res.better.zip.tree + res.better.zip + + + + + + + + + + - - res.better.zip.tree - res.better.zip - - - - - - - - - - + + res.better.zip.select + res.better.zip + + + + + + + + + + + + + + - - res.better.zip.select - res.better.zip - - - - - - - - - - - - - - + + Cites/locations + res.better.zip + form + tree,form + + + - - Cites/locations Management - res.better.zip - form - tree,form - - - + - + -
-
+ diff --git a/base_location/views/company_view.xml b/base_location/views/company_view.xml index e723db3a7..a2775ebd0 100644 --- a/base_location/views/company_view.xml +++ b/base_location/views/company_view.xml @@ -1,21 +1,19 @@ - - + - - - res.company.form.city - res.company - - - - - + + + res.company.form.city + res.company + + + + - + + - - + diff --git a/base_location/views/partner_view.xml b/base_location/views/partner_view.xml index cade97e03..cc3499b40 100644 --- a/base_location/views/partner_view.xml +++ b/base_location/views/partner_view.xml @@ -1,26 +1,24 @@ - - + - - res.partner.zip_id.2 - res.partner - - - - - - - - + + res.partner.zip_id.2 + res.partner + + + + - + + + + + - - + diff --git a/base_location/views/res_country_view.xml b/base_location/views/res_country_view.xml index 7e1deaa09..d45cd0cb1 100644 --- a/base_location/views/res_country_view.xml +++ b/base_location/views/res_country_view.xml @@ -1,17 +1,15 @@ - - + - - res.country.search - res.country - - - - - - - + + res.country.search + res.country + + + + + + + - - + diff --git a/base_location/views/state_view.xml b/base_location/views/state_view.xml index 38b550c97..e4e37845d 100644 --- a/base_location/views/state_view.xml +++ b/base_location/views/state_view.xml @@ -1,26 +1,26 @@ - - - - - view_country_state_form2 - res.country.state - - - - - - - - - - - + + + + + view_country_state_form2 + res.country.state + + + + + + + + + + - - - + + + +