Browse Source

[MIG] base_location: Migrated to 10.0

* Headers shortened
* Move cities management to settings
pull/523/head
Francesco Apruzzese 8 years ago
committed by Jairo Llopis
parent
commit
b046df78ee
  1. 5
      base_location/README.rst
  2. 23
      base_location/__init__.py
  3. 40
      base_location/__manifest__.py
  4. 6
      base_location/models/__init__.py
  5. 25
      base_location/models/better_zip.py
  6. 28
      base_location/models/company.py
  7. 27
      base_location/models/partner.py
  8. 26
      base_location/models/state.py
  9. 5
      base_location/tests/__init__.py
  10. 7
      base_location/tests/test_completion.py
  11. 22
      base_location/views/better_zip_view.xml
  12. 6
      base_location/views/company_view.xml
  13. 6
      base_location/views/partner_view.xml
  14. 6
      base_location/views/res_country_view.xml
  15. 8
      base_location/views/state_view.xml

5
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 <https://github.com/OCA/
partner_contact/issues/new?body=module:%20
base_location%0Aversion:%20
9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
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 <alejandrosantana@anubia.es>
* Sandy Carter <sandy.carter@savoirfairelinux.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Francesco Apruzzese <f.apruzzese@apuliasoftware.it>
Icon
----

23
base_location/__init__.py

@ -1,24 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2016 Nicolas Bessi, Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

40
base_location/__manifest__.py

@ -1,43 +1,19 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# 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,"
"Odoo Community Association (OCA)",
'license': "AGPL-3",
'contributors': [
'Nicolas Bessi <nicolas.bessi@camptocamp.com>',
'Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>',
'Ignacio Ibeas (Acysos S.L.)',
'Alejandro Santana <alejandrosantana@anubia.es>',
'Sandy Carter <sandy.carter@savoirfairelinux.com>',
'Yannick Vaucher <yannick.vaucher@camptocamp.com>',
],
'summary': '''Enhanced zip/npa management system''',
'website': 'http://www.camptocamp.com',
'data': ['views/better_zip_view.xml',
@ -49,6 +25,6 @@
'demo': [
'demo/better_zip.xml',
],
'installable': False,
'installable': True,
'auto_install': False,
}

6
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

25
base_location/models/better_zip.py

@ -1,25 +1,8 @@
# -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# 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 <http://www.gnu.org/licenses/>.
#
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):

28
base_location/models/company.py

@ -1,33 +1,14 @@
# -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# 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 <http://www.gnu.org/licenses/>.
#
#
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',
)

27
base_location/models/partner.py

@ -1,33 +1,14 @@
# -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# 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 <http://www.gnu.org/licenses/>.
#
#
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:

26
base_location/models/state.py

@ -1,26 +1,8 @@
# -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# 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 <http://www.gnu.org/licenses/>.
#
#
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):

5
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

7
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):

22
base_location/views/better_zip_view.xml

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="better_zip_form">
<field name="name">res.better.zip.form</field>
<field name="model">res.better.zip</field>
<field name="arch" type="xml">
<form string="ZIP">
<form string="City">
<group col="4">
<field name="name"/>
<field name="code"/>
@ -22,7 +21,7 @@
<field name="name">res.better.zip.tree</field>
<field name="model">res.better.zip</field>
<field name="arch" type="xml">
<tree string="ZIP">
<tree string="Cities">
<field name="name"/>
<field name="code"/>
<field name="city"/>
@ -51,7 +50,7 @@
</record>
<record id="action_zip_tree" model="ir.actions.act_window">
<field name="name">Cites/locations Management</field>
<field name="name">Cites/locations</field>
<field name="res_model">res.better.zip</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -61,10 +60,15 @@
<menuitem
name="Cities/Locations Management"
id="zip_base"
parent="base.menu_localisation"
id="locations_root_menu"
parent="base.menu_custom"
/>
<menuitem
name="Cities/Locations"
id="locations_menu"
parent="locations_root_menu"
action="action_zip_tree"
/>
</data>
</openerp>
</odoo>

6
base_location/views/company_view.xml

@ -1,6 +1,5 @@
<?xml version="1.0"?>
<openerp>
<data>
<odoo>
<!-- Add cities to the company form -->
<record id="view_company_form_city" model="ir.ui.view">
@ -17,5 +16,4 @@
</field>
</record>
</data>
</openerp>
</odoo>

6
base_location/views/partner_view.xml

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<odoo>
<record id="view_partner_form" model="ir.ui.view">
<field name="name">res.partner.zip_id.2</field>
@ -22,5 +21,4 @@
</field>
</record>
</data>
</openerp>
</odoo>

6
base_location/views/res_country_view.xml

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="view_country_search" model="ir.ui.view">
<field name="name">res.country.search</field>
@ -13,5 +12,4 @@
</field>
</record>
</data>
</openerp>
</odoo>

8
base_location/views/state_view.xml

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<openerp>
<data>
<odoo>
<!-- Add cities to the State form -->
<record model="ir.ui.view" id="view_country_state_form2">
<field name="name">view_country_state_form2</field>
@ -22,5 +22,5 @@
</field>
</field>
</record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save