[TMP]update if family.member

This commit is contained in:
michel 2018-01-23 11:14:39 +01:00
parent 94df44087b
commit 1a57c993e1

View File

@ -101,14 +101,13 @@ class GolemFamily(models.Model):
@api.onchange('member_ids') @api.onchange('member_ids')
def onchange_member(self): def onchange_member(self):
""" Sets as member address if there was no precedence """ """ Sets as member address if there was no precedence """
for family in self: for family in self:
if family.member_ids: if family.member_ids and not any((family.street, family.street2)):
if not any((family.street, family.street2)): family.update({'street': family.member_ids[0].street,
family.update({'street': family.member_ids[0].street, 'street2': family.member_ids[0].street2,
'street2': family.member_ids[0].street2, 'zip': family.member_ids[0].zip,
'zip': family.member_ids[0].zip, 'city': family.member_ids[0].city
'city': family.member_ids[0].city })
})
class GolemFamilyRole(models.Model): class GolemFamilyRole(models.Model):
""" GOLEM Family Role """ """ GOLEM Family Role """