[FIX] Added sql_constraint on adding field having size<1
lp bug: https://launchpad.net/bugs/399685 fixed bzr revid: hda@hda-20090715134530-4aj0hth1olefcpdn
This commit is contained in:
parent
64ffe9c680
commit
9148c7fcdf
|
@ -229,6 +229,9 @@ class ir_model_fields(osv.osv):
|
|||
'field_description': lambda *a: '',
|
||||
}
|
||||
_order = "id"
|
||||
_sql_constraints = [
|
||||
('size_gt_zero', 'CHECK (size>0)', 'Size of the field can never be less than 1 !'),
|
||||
]
|
||||
def unlink(self, cr, user, ids, context=None):
|
||||
for field in self.browse(cr, user, ids, context):
|
||||
if field.state <> 'manual':
|
||||
|
@ -255,6 +258,7 @@ class ir_model_fields(osv.osv):
|
|||
if self.pool.get(vals['model']):
|
||||
self.pool.get(vals['model']).__init__(self.pool, cr)
|
||||
self.pool.get(vals['model'])._auto_init(cr, {})
|
||||
|
||||
return res
|
||||
ir_model_fields()
|
||||
|
||||
|
|
Loading…
Reference in New Issue