[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
This commit is contained in:
Jay (OpenERP) 2010-08-30 13:24:08 +05:30
parent 6f6849744f
commit b6a3f0eda0
2 changed files with 9 additions and 4 deletions

View File

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

View File

@ -232,7 +232,7 @@
<field name="wiki_id" select="1" colspan="4"/>
<field name="summary" select="1" colspan="4"/>
<field name="text_area" select="1" colspan="4" nolabel="1" widget="text_wiki"/>
<field name="create_date" select="1"/>
<field name="create_date" select="1" readonly="1"/>
<field name="minor_edit" select="1" groups="base.group_extended"/>
</form>
</field>