Browse Source

[MIG] partner_address_street3 Migration to 11.0

pull/690/head
Huy Ly 7 years ago
committed by hveficent
parent
commit
47c97501e9
  1. 13
      partner_address_street3/README.rst
  2. 2
      partner_address_street3/__init__.py
  3. 3
      partner_address_street3/__manifest__.py
  4. 1
      partner_address_street3/hooks.py
  5. 4
      partner_address_street3/model/__init__.py
  6. 3
      partner_address_street3/model/country.py
  7. 12
      partner_address_street3/model/partner.py
  8. 2
      partner_address_street3/tests/__init__.py
  9. 5
      partner_address_street3/tests/test_street_3.py
  10. 1
      partner_address_street3/view/partner_view.xml

13
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 :alt: License: AGPL-3
=========================== ===========================
@ -14,7 +14,7 @@ Usage
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :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 Bug Tracker
=========== ===========
@ -22,7 +22,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues Bugs are tracked on `GitHub Issues
<https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please <https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first, 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 Credits
======= =======
@ -30,13 +30,16 @@ Credits
Images Images
------ ------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
* Odoo Community Association: `Icon <https://odoo-community.org/logo.png>`_.
Contributors Contributors
------------ ------------
* Nicolas Bessi <nicolas.bessi@camptocamp.com> * Nicolas Bessi <nicolas.bessi@camptocamp.com>
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com> * Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
* Huy Ly <huyly0909@gmail.com>
Do not contact contributors directly about support or help with technical issues.
Maintainer Maintainer
---------- ----------

2
partner_address_street3/__init__.py

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from . import model from . import model
from .hooks import post_init_hook from .hooks import post_init_hook
from .hooks import uninstall_hook from .hooks import uninstall_hook

3
partner_address_street3/__manifest__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2014-2016 Camptocamp SA # © 2014-2016 Camptocamp SA
# @author: Nicolas Bessi # @author: Nicolas Bessi
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@ -7,7 +6,7 @@
'name': 'Street3 in addresses', 'name': 'Street3 in addresses',
'summary': 'Add a third address line on partners', 'summary': 'Add a third address line on partners',
'license': 'AGPL-3', 'license': 'AGPL-3',
'version': '10.0.1.0.0',
'version': '11.0.1.0.0',
'author': "Camptocamp,Odoo Community Association (OCA)", 'author': "Camptocamp,Odoo Community Association (OCA)",
'maintainer': 'Camptocamp', 'maintainer': 'Camptocamp',
'category': 'Sales', 'category': 'Sales',

1
partner_address_street3/hooks.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Sodexis # Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

4
partner_address_street3/model/__init__.py

@ -1,4 +1,2 @@
# -*- coding: utf-8 -*-
from . import partner
from . import country from . import country
from . import partner

3
partner_address_street3/model/country.py

@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
# © 2014-2016 Camptocamp SA # © 2014-2016 Camptocamp SA
# @author: Nicolas Bessi # @author: Nicolas Bessi
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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): class ResCountry(models.Model):

12
partner_address_street3/model/partner.py

@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
# © 2014-2016 Camptocamp SA # © 2014-2016 Camptocamp SA
# @author: Nicolas Bessi # @author: Nicolas Bessi
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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): class ResPartner(models.Model):
@ -17,3 +16,12 @@ class ResPartner(models.Model):
fields = super(ResPartner, self)._address_fields() fields = super(ResPartner, self)._address_fields()
fields.append('street3') fields.append('street3')
return fields 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

2
partner_address_street3/tests/__init__.py

@ -1,3 +1 @@
# -*- coding: utf-8 -*-
from . import test_street_3 from . import test_street_3

5
partner_address_street3/tests/test_street_3.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2014-2016 Camptocamp SA # © 2014-2016 Camptocamp SA
# @author: Nicolas Bessi # @author: Nicolas Bessi
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) # © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
@ -29,8 +28,8 @@ class TestStreet3(TransactionCase):
'parent_id': homer.id, 'parent_id': homer.id,
'type': 'contact', 'type': 'contact',
}) })
self.assertEquals(bart.street3, 'Tho')
self.assertEqual(bart.street3, 'Tho')
# test synchro of street3 on write # test synchro of street3 on write
homer.write({'street3': 'in OCA we trust'}) homer.write({'street3': 'in OCA we trust'})
self.assertEquals(bart.street3, 'in OCA we trust')
self.assertEqual(bart.street3, 'in OCA we trust')

1
partner_address_street3/view/partner_view.xml

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="add_street3_in_form_view" model="ir.ui.view"> <record id="add_street3_in_form_view" model="ir.ui.view">

Loading…
Cancel
Save