[TMP] Golem_family #3

Manually merged
fabien merged 27 commits from michel/GOLEM:michel_famille into master 2018-01-29 15:36:00 +01:00
Showing only changes of commit 79c683b047 - Show all commits

View File

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