Added constraint on timesheet line: hours must be positive
This commit is contained in:
1 parent
9a74b1c3b1
commit
9d0ed1d9df
1 file changed
+7
@@ -18,6 +18,13 @@ class Line(OSV):
|
||||
required=True, select=1, domain=[('type', '!=', 'view')])
|
||||
description = fields.Char('Description')
|
||||
|
||||
def __init__(self):
|
||||
super(Line, self).__init__()
|
||||
self._sql_constraints += [
|
||||
('check_move_hours_pos',
|
||||
'CHECK(hours >= 0.0)', 'Hours field must be positive'),
|
||||
]
|
||||
|
||||
def default_employee(self, cursor, user_id, context=None):
|
||||
user_obj = self.pool.get('res.user')
|
||||
employee_obj = self.pool.get('company.employee')
|
||||
|
||||
Reference in new issue
Block a user