forked from Yaltik/golem
[TMP] change metode onchange_member
This commit is contained in:
parent
39fc7085b2
commit
30dad99689
@ -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,14 +102,16 @@ 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:
|
||||
family.street = family.member_ids.street
|
||||
family.street2 = family.member_ids.street2
|
||||
family.zip = family.member_ids.zip
|
||||
family.city = family.member_ids.city
|
||||
family.state_id = family.member_ids.state_id
|
||||
family.country_id = family.member_ids.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
|
||||
family.city = family.member_ids.city
|
||||
family.state_id = family.member_ids.state_id
|
||||
family.country_id = family.member_ids.country_id
|
||||
|
||||
class GolemFamilyRole(models.Model):
|
||||
""" GOLEM Family Role """
|
||||
|
Loading…
Reference in New Issue
Block a user