Colored Fields red ,those fail in constraint validation.
bzr revid: jvo@tinyerp.com-20081124124839-v4ryyp5odmm5bmqn
This commit is contained in:
parent
224297ad39
commit
67409c5dec
|
@ -300,6 +300,7 @@ class orm_template(object):
|
|||
_description = None
|
||||
_inherits = {}
|
||||
_table = None
|
||||
_invalids=[]
|
||||
|
||||
def _field_create(self, cr, context={}):
|
||||
cr.execute("SELECT id FROM ir_model_data WHERE name='%s'" % ('model_'+self._name.replace('.','_'),))
|
||||
|
@ -651,6 +652,9 @@ class orm_template(object):
|
|||
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'):
|
||||
raise _('The read method is not implemented on this object !')
|
||||
|
||||
def get_invalid_fields(self,cr,uid):
|
||||
return self._invalids.__str__()
|
||||
|
||||
def _validate(self, cr, uid, ids, context=None):
|
||||
context = context or {}
|
||||
lng = context.get('lang', False) or 'en_US'
|
||||
|
@ -663,6 +667,7 @@ class orm_template(object):
|
|||
error_msgs.append(
|
||||
_("Error occured while validating the field(s) %s: %s") % (','.join(fields), translated_msg)
|
||||
)
|
||||
self._invalids.extend(fields)
|
||||
if error_msgs:
|
||||
cr.rollback()
|
||||
raise except_orm('ValidateError', '\n'.join(error_msgs))
|
||||
|
|
Loading…
Reference in New Issue