From b6a3f0eda07bcba4287b3bd94781ace592c98e44 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Mon, 30 Aug 2010 13:24:08 +0530 Subject: [PATCH] [FIX] Wiki : Corrections for history revision differences,_rec_name corrected lp bug: https://launchpad.net/bugs/625287 fixed bzr revid: jvo@tinyerp.com-20100830075408-pafkjts8w19kucge --- addons/wiki/wiki.py | 11 ++++++++--- addons/wiki/wiki_view.xml | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index d82ae8e41b6..2cf22170cec 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -206,7 +206,7 @@ class History(osv.osv): _name = "wiki.wiki.history" _description = "Wiki History" - _rec_name = "date_time" + _rec_name = "summary" _order = 'id DESC' _columns = { @@ -230,8 +230,13 @@ class History(osv.osv): history_pool = self.pool.get('wiki.wiki.history') text1 = history_pool.read(cr, uid, [v1], ['text_area'])[0]['text_area'] text2 = history_pool.read(cr, uid, [v2], ['text_area'])[0]['text_area'] - line1 = text1.splitlines(1) - line2 = text2.splitlines(1) + line1 = line2 = '' + if text1: + line1 = text1.splitlines(1) + if text2: + line2 = text2.splitlines(1) + if (not line1 and not line2) or (line1 == line2): + raise osv.except_osv(_('Warning !'), _('There are no chnages in revisions')) diff = difflib.HtmlDiff() return diff.make_file(line1, line2, "Revision-%s" % (v1), "Revision-%s" % (v2), context=False) diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index a22267bd52a..5c9aa842e98 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -232,7 +232,7 @@ - +