From 2e98b96d80d2c88730736dd12f7c5bd1ab60d85d Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 6 Dec 2016 14:42:58 +0100 Subject: [PATCH] [MIG] partner_contact_lang: Migration to 9.0 --- partner_contact_lang/README.rst | 4 ++-- partner_contact_lang/__openerp__.py | 4 ++-- partner_contact_lang/models/res_partner.py | 5 ++--- partner_contact_lang/tests/test_partner_contact_lang.py | 2 +- partner_contact_lang/views/res_partner_view.xml | 9 +++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/partner_contact_lang/README.rst b/partner_contact_lang/README.rst index ecab7d3d5..0522bafff 100644 --- a/partner_contact_lang/README.rst +++ b/partner_contact_lang/README.rst @@ -25,7 +25,7 @@ and you will be able to edit the language. .. 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/8.0 + :target: https://runbot.odoo-community.org/runbot/134/9.0 Bug Tracker =========== @@ -52,7 +52,7 @@ Maintainer .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. diff --git a/partner_contact_lang/__openerp__.py b/partner_contact_lang/__openerp__.py index 6d154ab4d..6567618a4 100644 --- a/partner_contact_lang/__openerp__.py +++ b/partner_contact_lang/__openerp__.py @@ -4,7 +4,7 @@ { 'name': 'Manage language in contacts', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'category': 'Partner Management', 'license': 'AGPL-3', 'author': 'Tecnativa,' @@ -16,5 +16,5 @@ 'data': [ 'views/res_partner_view.xml', ], - 'installable': True + 'installable': True, } diff --git a/partner_contact_lang/models/res_partner.py b/partner_contact_lang/models/res_partner.py index 23d6e02f9..0b6b612c1 100644 --- a/partner_contact_lang/models/res_partner.py +++ b/partner_contact_lang/models/res_partner.py @@ -22,11 +22,10 @@ class ResPartner(models.Model): return res @api.multi - def onchange_address(self, use_parent_address, parent_id): + def onchange_parent_id(self, parent_id): """Change language if the parent company changes and there's no language defined yet""" - res = super(ResPartner, self).onchange_address( - use_parent_address, parent_id) + res = super(ResPartner, self).onchange_parent_id(parent_id) if parent_id and self.parent_id.id != parent_id and not self.lang: parent = self.browse(parent_id) val = res.setdefault('value', {}) diff --git a/partner_contact_lang/tests/test_partner_contact_lang.py b/partner_contact_lang/tests/test_partner_contact_lang.py index 273958854..945245198 100644 --- a/partner_contact_lang/tests/test_partner_contact_lang.py +++ b/partner_contact_lang/tests/test_partner_contact_lang.py @@ -21,7 +21,7 @@ class TestPartnerContactLang(common.TransactionCase): def test_onchange_parent_id(self): self.contact.parent_id = False - res = self.contact.onchange_address(False, self.partner.id) + res = self.contact.onchange_parent_id(self.partner.id) self.assertEqual(res.get('value', {}).get('lang'), 'en_US') def test_write_parent_lang(self): diff --git a/partner_contact_lang/views/res_partner_view.xml b/partner_contact_lang/views/res_partner_view.xml index 1213a38b9..4412c82af 100644 --- a/partner_contact_lang/views/res_partner_view.xml +++ b/partner_contact_lang/views/res_partner_view.xml @@ -1,16 +1,17 @@ - - + res.partner + 9999 + + - - +