Commit 3b230280 authored by Luca Cristaldi's avatar Luca Cristaldi

Use searcher/getter rec_name for the member model

parent 39bb7bb0
......@@ -29,11 +29,6 @@ class Member(Workflow, ModelSQL, ModelView):
'Member'
__name__ = "association.member"
_rec_name = 'party_name'
party_name = fields.Function(fields.Char("Party Name"),
'on_change_with_party_name',
searcher='search_party_member')
state = fields.Selection(STATES, 'State', readonly=True)
code = fields.Char('Code', required=True, select=True,
states={'readonly': Eval('code_readonly', True)},
......@@ -103,11 +98,6 @@ class Member(Workflow, ModelSQL, ModelView):
},
})
@fields.depends('party', '_parent_party.name')
def on_change_with_party_name(self, name=None):
if self.party:
return self.party.name
def get_code_readonly(self, name):
return True
......@@ -121,8 +111,11 @@ class Member(Workflow, ModelSQL, ModelView):
if sequence:
return Sequence.get_id(sequence.id)
def get_rec_name(self, name):
return self.party.rec_name
@classmethod
def search_party_member(cls, name, clause):
def search_rec_name(cls, name, clause):
return [('party', ) + tuple(clause[1:])]
@classmethod
......@@ -185,7 +178,7 @@ class Member(Workflow, ModelSQL, ModelView):
if not all(x.paid for x in pending_fees):
raise MemberUnpaidFeeError(
gettext('association.msg_unpaid_fee',
member=", ".join([x.party_name for x in members])))
member=", ".join([x.rec_name for x in members])))
for member in members:
if not member.leave_date:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment