Commit 46b1e5bb authored by Luca Cristaldi's avatar Luca Cristaldi

Fix pep8

parent e885f059
......@@ -38,7 +38,8 @@ class MembershipType(ModelSQL, ModelView):
__name__ = 'association.membership.type'
name = fields.Char('Name', size=None, required=True)
periods = fields.One2Many('association.membership.period', 'membership_type',
periods = fields.One2Many('association.membership.period',
'membership_type',
"Periods",
help="The periods that form the basis of the membership type.")
journal = fields.Many2One('account.journal', "Journal", required=True,
......@@ -129,7 +130,6 @@ class Membership(ModelSQL, ModelView):
for membership in memberships:
membership.check_dates()
def check_dates(self):
transaction = Transaction()
connection = transaction.connection
......@@ -139,11 +139,11 @@ class Membership(ModelSQL, ModelView):
cursor.execute(
*table.select(table.id,
where=(((table.start_date <= self.start_date)
& (table.end_date >= self.start_date))
| ((table.start_date <= self.end_date)
& (table.end_date >= self.end_date))
| ((table.start_date >= self.start_date)
& (table.end_date <= self.end_date)))
& (table.end_date >= self.start_date))
| ((table.start_date <= self.end_date)
& (table.end_date >= self.end_date))
| ((table.start_date >= self.start_date)
& (table.end_date <= self.end_date)))
& (table.membership_type == self.membership_type.id)
& (table.id != self.id)))
period_id = cursor.fetchone()
......@@ -178,7 +178,8 @@ class Period(ModelSQL, ModelView):
"""Membership period"""
__name__ = 'association.membership.period'
membership_type = fields.Many2One('association.membership.type', "Membership Type",
membership_type = fields.Many2One('association.membership.type',
"Membership Type",
required=True,
select=True,
domain=[
......@@ -254,7 +255,8 @@ class Fee(ModelSQL, ModelView):
_states = {
'readonly':
Bool(Eval('move')) and Eval('fee', Decimal('0.0')) == Decimal('0.0')
Bool(Eval('move'))
and Eval('fee', Decimal('0.0')) == Decimal('0.0')
}
member = fields.Many2One('association.member', "Member", required=True,
......
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