fix the bug for the wiki to start history from the first page

and not from the first edit

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

bzr revid: mga@tinyerp.com-20090319062339-pclxu7k0slwpif8h
This commit is contained in:
Mantavya Gajjar
2009-03-19 11:53:39 +05:30
parent 80ee20fd3e
commit 914f2d6044
+14
View File
@@ -105,6 +105,20 @@ class Wiki(osv.osv):
def copy_data(self, cr, uid, id, default=None, context=None):
return super(Wiki, self).copy_data(cr, uid, id, {'wiki_id':False}, context)
def create(self, cr, uid, vals, context=None):
id = super(Wiki,self).create(cr, uid, vals, context)
history = self.pool.get('wiki.wiki.history')
if vals.get('text_area'):
res = {
'minor_edit':vals.get('minor_edit', True),
'text_area':vals.get('text_area',''),
'write_uid':uid,
'wiki_id' : id,
'summary':vals.get('summary','')
}
history.create(cr, uid, res)
return id
def write(self, cr, uid, ids, vals, context=None):
result = super(Wiki,self).write(cr, uid, ids, vals, context)
history = self.pool.get('wiki.wiki.history')