From e5cf4ad9d4049677d8f5819a365dea2e2c87e052 Mon Sep 17 00:00:00 2001 From: michel Date: Mon, 22 Jan 2018 12:37:06 +0100 Subject: [PATCH] [TMP] change metode onchange_member --- golem_family/models/golem_family.py | 12 ++++++------ golem_family/views/golem_member_views.xml | 7 ------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/golem_family/models/golem_family.py b/golem_family/models/golem_family.py index 64ae06f..a13fa55 100644 --- a/golem_family/models/golem_family.py +++ b/golem_family/models/golem_family.py @@ -98,12 +98,12 @@ class GolemFamily(models.Model): for family in self: family.count = len(family.member_ids) - # @api.onchange('member_ids') - # def onchange_member(self): - # """ Sets as member address if there was no precedence """ - # for family in self: - # if not any({'family.street': False}): - # self.update({'family.street': family.member_ids.street}) + @api.onchange('member_ids') + def onchange_member(self): + """ Sets as member address if there was no precedence """ + for family in self: + if not any ({'family.street': True}): + self.update({'family.street': family.member_ids.street}) class GolemFamilyRole(models.Model): """ GOLEM Family Role """ diff --git a/golem_family/views/golem_member_views.xml b/golem_family/views/golem_member_views.xml index dad1b4a..2d1e17e 100644 --- a/golem_family/views/golem_member_views.xml +++ b/golem_family/views/golem_member_views.xml @@ -34,13 +34,6 @@ along with this program. If not, see . - - - - - - -