fix the bug for the wiki

start keeping history from the first page and from the fisrt edit

bzr revid: mga@tinyerp.com-20090319062858-8p7igod7civlfjsz
This commit is contained in:
Mantavya Gajjar 2009-03-19 11:58:58 +05:30
parent c72da62763
commit 01c974e40d
1 changed files with 14 additions and 0 deletions

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')