forked from Yaltik/golem
Add family members to membership invoice
This commit is contained in:
parent
95426c0e90
commit
7911a9c630
@ -33,11 +33,15 @@ class GolemMembershipInvoice(models.TransientModel):
|
|||||||
def onchange_member(self):
|
def onchange_member(self):
|
||||||
""" Set partner domain if src_member_id is filled """
|
""" Set partner domain if src_member_id is filled """
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
record = self[0]
|
record = self[0]
|
||||||
domain = ([('id', 'in',
|
if record.src_member_id.is_minor:
|
||||||
record.src_member_id.mapped('legal_guardian_ids.legal_guardian_id').ids)]
|
partner_ids = record.src_member_id.mapped('legal_guardian_ids.legal_guardian_id').ids
|
||||||
if record.src_member_id.is_minor else [])
|
else:
|
||||||
return {'domain': {'partner_id': domain}}
|
partner_ids = []
|
||||||
|
if hasattr(record.src_member_id, 'family_member_ids'):
|
||||||
|
partner_ids += record.src_member_id.family_member_ids.filtered(
|
||||||
|
lambda r: r.id != self.src_member_id.partner_id.id).ids
|
||||||
|
return {'domain': {'partner_id': [('id', 'in', partner_ids)]}}
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def membership_invoice(self):
|
def membership_invoice(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user