From 914f2d60441cd2cef231c60b0c580944b02625de Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Thu, 19 Mar 2009 11:53:39 +0530 Subject: [PATCH] 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 --- addons/wiki/wiki.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index 8bcf87aa63a..5178fc4c5e7 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -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')