From 88db74c4c3dc04cfa72c91a6865b0f0ee1f9a9bb Mon Sep 17 00:00:00 2001 From: Dave Lasley Date: Fri, 27 Jan 2017 19:13:36 -0800 Subject: [PATCH] [FIX] partner_firstname: Fix names_order_changed computation * Fix assignment, singleton issue, and missing depends in `names_order_changed` --- partner_firstname/__openerp__.py | 2 +- partner_firstname/models/base_config_settings.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/partner_firstname/__openerp__.py b/partner_firstname/__openerp__.py index 5607246dc..945a9f529 100644 --- a/partner_firstname/__openerp__.py +++ b/partner_firstname/__openerp__.py @@ -21,7 +21,7 @@ { 'name': 'Partner first name and last name', 'summary': "Split first name and last name for non company partners", - 'version': '8.0.2.2.0', + 'version': '8.0.2.2.1', "author": "Camptocamp, " "Grupo ESOC IngenierĂ­a de Servicios, " "Odoo Community Association (OCA)", diff --git a/partner_firstname/models/base_config_settings.py b/partner_firstname/models/base_config_settings.py index e79b9d5dd..877b7b39e 100644 --- a/partner_firstname/models/base_config_settings.py +++ b/partner_firstname/models/base_config_settings.py @@ -36,10 +36,15 @@ 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 + 'partner_names_order', self._partner_names_order_default(), + ) + 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):