Commit a3d7255c authored by Luca Cristaldi's avatar Luca Cristaldi

relax join date constraint

parent a2262396
......@@ -68,10 +68,8 @@ class Member(Workflow, ModelSQL, ModelView):
help="The party that represents the member.")
join_date = fields.Date("Join Date",
states={
'readonly':
(Eval('state') != 'draft') | Eval('join_date'),
'required':
Eval('state') != 'draft'
'readonly': Eval('state') != 'draft',
'required': Eval('state') != 'draft'
},
domain=[
If(
......@@ -125,10 +123,16 @@ class Member(Workflow, ModelSQL, ModelView):
'depends': ['state'],
},
'run': {
'pre_validate': [
('join_date', '!=', None),
],
'invisible': Eval('state').in_(['stopped', 'running']),
'depends': ['state'],
},
'stop': {
'pre_validate': [
('leave_date', '!=', None),
],
'invisible': Eval('state').in_(['draft', 'stopped']),
'depends': ['state'],
},
......
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