[TMP] change metode onchange_member

This commit is contained in:
michel 2018-01-18 16:11:36 +01:00
parent 39fc7085b2
commit 30dad99689

View File

@ -39,7 +39,7 @@ class ResPartner(models.Model):
'view_mode': 'form',
'res_id': self.family_id.id}
# code ici
class GolemMember(models.Model):
""" Member adaptations """
_inherit = 'golem.member'
@ -102,8 +102,10 @@ class GolemFamily(models.Model):
def onchange_member(self):
""" Sets as member address if there was no precedence """
for family in self:
if not family.street or family.street2 or family.zip or \
family.city or family.state_id or family.country_id:
if family.id:
if not any({'family.street': False, 'family.street2': False, \
'family.zip': False, 'family.city': False, \
'family.state_id': False, 'family.country_id': False}):
family.street = family.member_ids.street
family.street2 = family.member_ids.street2
family.zip = family.member_ids.zip