From e73f4dfd6d79dfd14e23e3c2059e2ea7f4fb2a4d Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Mon, 24 Nov 2008 13:22:15 +0530 Subject: implement * differance wizard to show diff between 2 history lines bzr revid: mga@tinyerp.com-20081124075215-7bhiqoyc6vray2bg --- addons/wiki/wizard/show_diff.py | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 addons/wiki/wizard/show_diff.py (limited to 'addons/wiki/wizard/show_diff.py') diff --git a/addons/wiki/wizard/show_diff.py b/addons/wiki/wizard/show_diff.py new file mode 100644 index 00000000000..6ea9bcf814d --- /dev/null +++ b/addons/wiki/wizard/show_diff.py @@ -0,0 +1,50 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields,osv + + + +class showdiff(osv.osv_memory): + _name = 'wizard.wiki.history.show_diff' + + def _get_diff(self, cr, uid, ctx): + print 'XXXXXXXXXXXXXXXXXX : ', ctx + history = self.pool.get('wiki.wiki.history') + res = {} +# if lan(ids) == 2: +# diff = history.getDiff(cr, uid, ids[0]. ids[1]) +# res = { +# ids[0] : diff, +# ids[1] : diff, +# } + return res + + _columns = { + 'diff': fields.function(_get_diff, method=True, type='char', string='Diff'), + } + _defaults = { + 'diff': _get_diff + } +showdiff() + + \ No newline at end of file -- cgit v1.2.3