[FIX] Fixed error notification on parent_store=true with a column without ondelete=cascade

lp bug: https://launchpad.net/bugs/522227 fixed

bzr revid: jvo@tinyerp.com-20100216075143-f0e3axlg1m2eskmq
This commit is contained in:
Jay (Open ERP)
2010-02-16 13:21:43 +05:30
parent 1d5272071d
commit 0d836ea56e
+1 -1
View File
@@ -1745,7 +1745,7 @@ class orm(orm_template):
if 'parent_right' not in self._columns:
logger.notifyChannel('orm', netsvc.LOG_ERROR, 'create a column parent_right on object %s: fields.integer(\'Right Parent\', select=1)' % (self._table, ))
if self._columns[self._parent_name].ondelete<>'cascade':
logger.notifyChannel('orm', netsvc.LOG_ERROR, "the columns %s on object must be set as ondelete='cascasde'" % (self._name, self._parent_name))
logger.notifyChannel('orm', netsvc.LOG_ERROR, "The column %s on object %s must be set as ondelete='cascade'" % (self._parent_name, self._name))
cr.execute('ALTER TABLE "%s" ADD COLUMN "parent_left" INTEGER' % (self._table,))
cr.execute('ALTER TABLE "%s" ADD COLUMN "parent_right" INTEGER' % (self._table,))
cr.commit()