From ab040f1d82646550b8c367047b0661f1c33da335 Mon Sep 17 00:00:00 2001 From: Fabien Bourgeois Date: Wed, 20 Jul 2016 18:48:15 +0200 Subject: [PATCH] [IMP]GOLEM Member Minor Multiple legal guardians --- golem_member_minor/golem_member.py | 7 +++++-- golem_member_minor/golem_member_view.xml | 18 +++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/golem_member_minor/golem_member.py b/golem_member_minor/golem_member.py index 6101ba6..c81eb03 100644 --- a/golem_member_minor/golem_member.py +++ b/golem_member_minor/golem_member.py @@ -23,8 +23,11 @@ class GolemMember(models.Model): _inherit = 'golem.member' ADULT_DURATION = timedelta(days=365*18) - legal_guardian = fields.Many2one('res.partner', 'Legal guardian', - domain=[('is_company', '=', False)]) + legal_guardian_ids = fields.Many2many('res.partner', + string='Legal guardians', + domain="['&', " + "('is_company', '=', False), " + "('id', '!=', partner_id)]") activities_participation = fields.Boolean('Activities participation?') is_minor = fields.Boolean('Is minor?', compute='_compute_is_minor', store=True, default=False) diff --git a/golem_member_minor/golem_member_view.xml b/golem_member_minor/golem_member_view.xml index d1afcad..0eaa795 100644 --- a/golem_member_minor/golem_member_view.xml +++ b/golem_member_minor/golem_member_view.xml @@ -33,14 +33,18 @@ along with this program. If not, see . - - - - - - + + + + + + + + + + +