29
29
_name = 'program.action.level'
31
31
def create(self, cr, uid, data, context=None):
32
if data.get('depth', -1) < 0:
38
33
raise orm.except_orm(
40
35
_('Depth must be greater than or equal to 0.')
44
program_action_level, self).create(cr, uid, data, context=context)
37
return super(program_action_level, self).create(
38
cr, uid, data, context=context)
46
40
def write(self, cr, uid, ids, vals, context=None):
55
_('Depth must be greater than or equal to 0.')
59
program_action_level, self).write(
41
if vals.get('depth', 0) < 0:
44
_('Depth must be greater than or equal to 0.')
46
return super(program_action_level, self).write(
60
47
cr, uid, ids, vals, context=context)
62
49
def name_get(self, cr, uid, ids, context=None):
69
56
'name': fields.char(
57
'Name', size=128, required=True, select=True, translate=True),
77
58
'action': fields.one2many(
88
'depth': fields.integer(
59
'program.action', 'action_level', string='Action'),
60
'code': fields.char('Code', size=32),
61
'depth': fields.integer('Level', required=True),