From 0b1d1a14448c57811c25faaf95843fbfc2dc2836 Mon Sep 17 00:00:00 2001 From: Dave Lasley Date: Sun, 13 Nov 2016 15:53:24 -0800 Subject: [PATCH] [MIG] partner_firstname: Style improvements for forward port * Prefer odoo to openerp & remove data tags * Move exceptions file out of models --- partner_firstname/README.rst | 6 +++--- partner_firstname/__openerp__.py | 1 + partner_firstname/{models => }/exceptions.py | 0 partner_firstname/models/__init__.py | 1 + partner_firstname/models/base_config_settings.py | 6 +++++- .../models/{res_user.py => res_users.py} | 0 partner_firstname/tests/base.py | 2 +- partner_firstname/tests/test_empty.py | 2 +- partner_firstname/views/base_config_view.xml | 11 ++++------- partner_firstname/views/res_partner.xml | 6 ++---- partner_firstname/views/res_user.xml | 6 ++---- 11 files changed, 20 insertions(+), 21 deletions(-) rename partner_firstname/{models => }/exceptions.py (100%) rename partner_firstname/models/{res_user.py => res_users.py} (100%) diff --git a/partner_firstname/README.rst b/partner_firstname/README.rst index 224535347..339c07d95 100644 --- a/partner_firstname/README.rst +++ b/partner_firstname/README.rst @@ -47,7 +47,7 @@ supply the *last name* and *first name* (just once per contact). .. 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 For further information, please visit: @@ -68,8 +68,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 `here -`_. +help us smashing it by providing a detailed and welcomed feedback. Credits ======= @@ -93,6 +92,7 @@ Contributors * Ronald Portier * Sylvain Van Hoof * Pedro Baeza +* Dave Lasley Translations ------------ diff --git a/partner_firstname/__openerp__.py b/partner_firstname/__openerp__.py index 199a109c4..fa4b3baf0 100644 --- a/partner_firstname/__openerp__.py +++ b/partner_firstname/__openerp__.py @@ -10,6 +10,7 @@ 'version': '9.0.2.0.0', 'author': "Camptocamp, " "Grupo ESOC Ingeniería de Servicios, " + "Tecnativa, " "Odoo Community Association (OCA)", 'license': "AGPL-3", 'maintainer': 'Camptocamp, Acsone', diff --git a/partner_firstname/models/exceptions.py b/partner_firstname/exceptions.py similarity index 100% rename from partner_firstname/models/exceptions.py rename to partner_firstname/exceptions.py diff --git a/partner_firstname/models/__init__.py b/partner_firstname/models/__init__.py index aa04cb891..05e809bb7 100644 --- a/partner_firstname/models/__init__.py +++ b/partner_firstname/models/__init__.py @@ -4,3 +4,4 @@ from . import base_config_settings from . import res_partner +from . import res_users diff --git a/partner_firstname/models/base_config_settings.py b/partner_firstname/models/base_config_settings.py index e79b9d5dd..2a226496a 100644 --- a/partner_firstname/models/base_config_settings.py +++ b/partner_firstname/models/base_config_settings.py @@ -36,10 +36,14 @@ class BaseConfigSettings(models.TransientModel): } @api.multi + @api.depends('partner_names_order') def _compute_names_order_changed(self): current = self.env['ir.config_parameter'].get_param( 'partner_names_order', self._partner_names_order_default()) - return self.partner_names_order != current + for record in self: + record.partner_names_order_changed = bool( + record.partner_names_order != current + ) @api.onchange('partner_names_order') def _onchange_partner_names_order(self): diff --git a/partner_firstname/models/res_user.py b/partner_firstname/models/res_users.py similarity index 100% rename from partner_firstname/models/res_user.py rename to partner_firstname/models/res_users.py diff --git a/partner_firstname/tests/base.py b/partner_firstname/tests/base.py index d1befbd87..15a2c795d 100644 --- a/partner_firstname/tests/base.py +++ b/partner_firstname/tests/base.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase -from ..models import exceptions as ex +from .. import exceptions as ex class MailInstalled(): diff --git a/partner_firstname/tests/test_empty.py b/partner_firstname/tests/test_empty.py index b4b51d497..4728ca20c 100644 --- a/partner_firstname/tests/test_empty.py +++ b/partner_firstname/tests/test_empty.py @@ -8,7 +8,7 @@ To have more accurate results, remove the ``mail`` module before testing. """ from openerp.tests.common import TransactionCase from .base import MailInstalled -from ..models import exceptions as ex +from .. import exceptions as ex class CompanyCase(TransactionCase): diff --git a/partner_firstname/views/base_config_view.xml b/partner_firstname/views/base_config_view.xml index f78b0a10f..424b5d28f 100644 --- a/partner_firstname/views/base_config_view.xml +++ b/partner_firstname/views/base_config_view.xml @@ -1,15 +1,14 @@ - - + Add partner_names_order config parameter base.config.settings - +