From 81f2b0d03b2f0747d1be06cac9cf30e9129119cc Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Wed, 18 Jul 2018 11:18:28 +0200 Subject: [PATCH] [FIX]GOLEM Member : better naming and res.partner form fix --- golem_member/__manifest__.py | 2 +- golem_member/models/golem_member.py | 8 +++++--- golem_member/views/res_partner_views.xml | 9 +++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/golem_member/__manifest__.py b/golem_member/__manifest__.py index 9c73964..e1e8980 100644 --- a/golem_member/__manifest__.py +++ b/golem_member/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM non-profit members', 'summary': 'Extends Odoo contacts for MJC', 'description': 'Extends Odoo contacts for MJC', - 'version': '10.0.1.2.1', + 'version': '10.0.1.2.2', 'category': 'GOLEM', 'author': 'Fabien Bourgeois, Michel Dessenne', 'license': 'AGPL-3', diff --git a/golem_member/models/golem_member.py b/golem_member/models/golem_member.py index 2d37e68..fbf9125 100644 --- a/golem_member/models/golem_member.py +++ b/golem_member/models/golem_member.py @@ -118,10 +118,12 @@ class GolemMember(models.Model): def _compute_number_name(self): """ Computes a name composed with number and name """ for member in self: + vals = [] + if member.number: + vals.append(member.number) if member.name: - member.number_name = u'{} - {}'.format(member.number, member.name) - else: - member.number_name = u'' + vals.append(member.name) + member.number_name = u' - '.join(vals) @api.depends('season_ids') def _compute_is_current(self): diff --git a/golem_member/views/res_partner_views.xml b/golem_member/views/res_partner_views.xml index 9ac3f1d..065f957 100644 --- a/golem_member/views/res_partner_views.xml +++ b/golem_member/views/res_partner_views.xml @@ -1,7 +1,7 @@