diff --git a/partner_address_street3/README.rst b/partner_address_street3/README.rst index e966a36f3..441aa4640 100644 --- a/partner_address_street3/README.rst +++ b/partner_address_street3/README.rst @@ -1,5 +1,5 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl :alt: License: AGPL-3 =========================== @@ -14,7 +14,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/10.0 + :target: https://runbot.odoo-community.org/runbot/134/11.0 Bug Tracker =========== @@ -22,7 +22,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. 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. +help us smash it by providing detailed and welcomed feedback. Credits ======= @@ -30,13 +30,16 @@ Credits Images ------ -* Odoo Community Association: `Icon `_. +* Odoo Community Association: `Icon `_. Contributors ------------ * Nicolas Bessi * Alexandre Fayolle +* Huy Ly + +Do not contact contributors directly about support or help with technical issues. Maintainer ---------- @@ -51,4 +54,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file diff --git a/partner_address_street3/__init__.py b/partner_address_street3/__init__.py index ae5d94619..b606c6d48 100644 --- a/partner_address_street3/__init__.py +++ b/partner_address_street3/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from . import model 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 c0e1c829c..388943731 100644 --- a/partner_address_street3/__manifest__.py +++ b/partner_address_street3/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2014-2016 Camptocamp SA # @author: Nicolas Bessi # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -7,7 +6,7 @@ 'name': 'Street3 in addresses', 'summary': 'Add a third address line on partners', 'license': 'AGPL-3', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'author': "Camptocamp,Odoo Community Association (OCA)", 'maintainer': 'Camptocamp', 'category': 'Sales', diff --git a/partner_address_street3/hooks.py b/partner_address_street3/hooks.py index 7cce70c54..be95879f7 100644 --- a/partner_address_street3/hooks.py +++ b/partner_address_street3/hooks.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 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 index 4bbda1be2..9535da517 100644 --- a/partner_address_street3/model/__init__.py +++ b/partner_address_street3/model/__init__.py @@ -1,4 +1,2 @@ -# -*- coding: utf-8 -*- - -from . import partner from . import country +from . import partner diff --git a/partner_address_street3/model/country.py b/partner_address_street3/model/country.py index acece74dc..886f7505f 100644 --- a/partner_address_street3/model/country.py +++ b/partner_address_street3/model/country.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # © 2014-2016 Camptocamp SA # @author: Nicolas Bessi # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields +from odoo import fields, models class ResCountry(models.Model): diff --git a/partner_address_street3/model/partner.py b/partner_address_street3/model/partner.py index a12490ed8..5c2ae003d 100644 --- a/partner_address_street3/model/partner.py +++ b/partner_address_street3/model/partner.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # © 2014-2016 Camptocamp SA # @author: Nicolas Bessi # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api +from odoo import api, fields, models class ResPartner(models.Model): @@ -17,3 +16,12 @@ class ResPartner(models.Model): fields = super(ResPartner, self)._address_fields() fields.append('street3') return fields + + @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) + while '\n\n' in res: + res = res.replace('\n\n', '\n') + return res diff --git a/partner_address_street3/tests/__init__.py b/partner_address_street3/tests/__init__.py index cace53b9f..6885a06a4 100644 --- a/partner_address_street3/tests/__init__.py +++ b/partner_address_street3/tests/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import test_street_3 diff --git a/partner_address_street3/tests/test_street_3.py b/partner_address_street3/tests/test_street_3.py index d83ee029a..c96757034 100644 --- a/partner_address_street3/tests/test_street_3.py +++ b/partner_address_street3/tests/test_street_3.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2014-2016 Camptocamp SA # @author: Nicolas Bessi # © 2016 Akretion (Alexis de Lattre ) @@ -29,8 +28,8 @@ class TestStreet3(TransactionCase): 'parent_id': homer.id, 'type': 'contact', }) - self.assertEquals(bart.street3, 'Tho') + self.assertEqual(bart.street3, 'Tho') # test synchro of street3 on write homer.write({'street3': 'in OCA we trust'}) - self.assertEquals(bart.street3, 'in OCA we trust') + self.assertEqual(bart.street3, 'in OCA we trust') diff --git a/partner_address_street3/view/partner_view.xml b/partner_address_street3/view/partner_view.xml index c8617c211..7c4c5d14d 100644 --- a/partner_address_street3/view/partner_view.xml +++ b/partner_address_street3/view/partner_view.xml @@ -1,4 +1,3 @@ -