diff --git a/partner_address_street3/__init__.py b/partner_address_street3/__init__.py index b606c6d48..3568264f5 100644 --- a/partner_address_street3/__init__.py +++ b/partner_address_street3/__init__.py @@ -1,3 +1,3 @@ -from . import model +from . import models from .hooks import post_init_hook from .hooks import uninstall_hook diff --git a/partner_address_street3/__manifest__.py b/partner_address_street3/__manifest__.py index 7e4da8c2f..158c5f9d2 100644 --- a/partner_address_street3/__manifest__.py +++ b/partner_address_street3/__manifest__.py @@ -1,4 +1,4 @@ -# © 2014-2016 Camptocamp SA +# Copyright 2014-2020 Camptocamp SA # @author: Nicolas Bessi # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -6,13 +6,13 @@ 'name': 'Street3 in addresses', 'summary': 'Add a third address line on partners', 'license': 'AGPL-3', - 'version': '12.0.1.0.0', + 'version': '14.0.1.0.0', 'author': "Camptocamp,Odoo Community Association (OCA)", 'maintainer': 'Camptocamp', 'category': 'Sales', - 'depends': ['base'], + 'depends': ['base_view_inheritance_extension'], 'website': 'https://github.com/OCA/partner-contact', - 'data': ['view/partner_view.xml'], + 'data': ['views/res_partner.xml'], 'post_init_hook': 'post_init_hook', 'uninstall_hook': 'uninstall_hook', 'installable': True, diff --git a/partner_address_street3/hooks.py b/partner_address_street3/hooks.py index be95879f7..c46c578d3 100644 --- a/partner_address_street3/hooks.py +++ b/partner_address_street3/hooks.py @@ -1,4 +1,4 @@ -# Copyright 2016 Sodexis +# Copyright 2016-2020 Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/partner_address_street3/model/__init__.py b/partner_address_street3/model/__init__.py deleted file mode 100644 index 9535da517..000000000 --- a/partner_address_street3/model/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from . import country -from . import partner diff --git a/partner_address_street3/models/__init__.py b/partner_address_street3/models/__init__.py new file mode 100644 index 000000000..5f65f0595 --- /dev/null +++ b/partner_address_street3/models/__init__.py @@ -0,0 +1,2 @@ +from . import res_country +from . import res_partner diff --git a/partner_address_street3/model/country.py b/partner_address_street3/models/res_country.py similarity index 92% rename from partner_address_street3/model/country.py rename to partner_address_street3/models/res_country.py index 886f7505f..a0b787932 100644 --- a/partner_address_street3/model/country.py +++ b/partner_address_street3/models/res_country.py @@ -1,4 +1,4 @@ -# © 2014-2016 Camptocamp SA +# Copyright 2014-2020 Camptocamp SA # @author: Nicolas Bessi # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/partner_address_street3/model/partner.py b/partner_address_street3/models/res_partner.py similarity index 67% rename from partner_address_street3/model/partner.py rename to partner_address_street3/models/res_partner.py index 5c2ae003d..d3cd747b2 100644 --- a/partner_address_street3/model/partner.py +++ b/partner_address_street3/models/res_partner.py @@ -1,4 +1,4 @@ -# © 2014-2016 Camptocamp SA +# Copyright 2014-2020 Camptocamp SA # @author: Nicolas Bessi # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -13,15 +13,13 @@ class ResPartner(models.Model): @api.model def _address_fields(self): - fields = super(ResPartner, self)._address_fields() - fields.append('street3') - return fields + res = super()._address_fields() + res.append('street3') + return res - @api.multi def _display_address(self, without_company=False): """Remove empty lines which can happen when street3 field is empty.""" - res = super(ResPartner, self)._display_address( - without_company=without_company) + res = super()._display_address(without_company=without_company) while '\n\n' in res: res = res.replace('\n\n', '\n') return res diff --git a/partner_address_street3/readme/CONTRIBUTORS.rst b/partner_address_street3/readme/CONTRIBUTORS.rst index fc8e0eb25..c579adabc 100644 --- a/partner_address_street3/readme/CONTRIBUTORS.rst +++ b/partner_address_street3/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ * Nicolas Bessi * Alexandre Fayolle * Huy Ly +* Alexis de Lattre diff --git a/partner_address_street3/tests/test_street_3.py b/partner_address_street3/tests/test_street_3.py index c96757034..2e1355a8f 100644 --- a/partner_address_street3/tests/test_street_3.py +++ b/partner_address_street3/tests/test_street_3.py @@ -1,6 +1,7 @@ -# © 2014-2016 Camptocamp SA +# Copyright 2014-2020 Camptocamp SA # @author: Nicolas Bessi -# © 2016 Akretion (Alexis de Lattre ) +# Copyright 2016-2020 Akretion (http://www.akretion.com/) +# @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.tests.common import TransactionCase diff --git a/partner_address_street3/view/partner_view.xml b/partner_address_street3/views/res_partner.xml similarity index 69% rename from partner_address_street3/view/partner_view.xml rename to partner_address_street3/views/res_partner.xml index 7c4c5d14d..ca7729989 100644 --- a/partner_address_street3/view/partner_view.xml +++ b/partner_address_street3/views/res_partner.xml @@ -1,6 +1,6 @@ - + add street3 in form view res.partner @@ -8,33 +8,27 @@ - - {'default_parent_id': active_id, - 'default_street': street, 'default_street2': street2, - 'default_street3': street3, 'default_city': city, 'default_state_id': - state_id, 'default_zip': zip, 'default_country_id': country_id, - 'default_supplier': supplier, 'default_customer': customer, - 'default_lang': lang,} + street3 - - - + add street 3 in kanban res.partner @@ -56,4 +50,15 @@ + + add street 3 in res.partner.form.private + res.partner + + + + + + + + diff --git a/setup/partner_address_street3/odoo/addons/partner_address_street3 b/setup/partner_address_street3/odoo/addons/partner_address_street3 new file mode 120000 index 000000000..b0425f525 --- /dev/null +++ b/setup/partner_address_street3/odoo/addons/partner_address_street3 @@ -0,0 +1 @@ +../../../../partner_address_street3 \ No newline at end of file diff --git a/setup/partner_address_street3/setup.py b/setup/partner_address_street3/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/partner_address_street3/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)