diff --git a/work.py b/work.py index e4a8c867ed..b001a59d41 100644 --- a/work.py +++ b/work.py @@ -20,6 +20,10 @@ class Work(OSV): ('view', 'View'), ('normal', 'Normal'), ], 'Type', required=True, select=1) + state = fields.Selection([ + ('opened', 'Opened'), + ('closed', 'Closed'), + ], 'State', required=True, select=1) def __init__(self): super(Work, self).__init__() @@ -34,6 +38,9 @@ class Work(OSV): def default_type(self, cursor, user, context=None): return 'normal' + def default_state(self, cursor, user, context=None): + return 'opened' + def get_complete_name(self, cursor, user, ids, name, arg, context=None): res = self.name_get(cursor, user, ids, context=context) return dict(res) diff --git a/work.xml b/work.xml index 7ddfac0f4e..9b670fa796 100644 --- a/work.xml +++ b/work.xml @@ -9,8 +9,12 @@