diff options
| author | ksa (Open ERP) <ksa@tinyerp.co.in> | 2010-04-12 18:11:47 +0530 |
|---|---|---|
| committer | ksa (Open ERP) <ksa@tinyerp.co.in> | 2010-04-12 18:11:47 +0530 |
| commit | 50cc43b94e161ff2e9fab3b42464045e4f6c38b2 (patch) | |
| tree | 75489bc831fb29c847786cf1f88c718218e6a4a3 /addons/wiki/wizard/show_diff.py | |
| parent | 0a9e3631e204a103b16dcd3cdd5dc9fabba4caf9 (diff) | |
[IMP]: wiki: Apply changes in wizard
bzr revid: ksa@tinyerp.co.in-20100412124147-kejx3dff80fxfjt8
Diffstat (limited to 'addons/wiki/wizard/show_diff.py')
| -rw-r--r-- | addons/wiki/wizard/show_diff.py | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/addons/wiki/wizard/show_diff.py b/addons/wiki/wizard/show_diff.py deleted file mode 100644 index 83708a8d8ce..00000000000 --- a/addons/wiki/wizard/show_diff.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -from osv import fields, osv -from tools.translate import _ - -class showdiff(osv.osv_memory): - """ Disp[ay Difference for History """ - - _name = 'wizard.wiki.history.show_diff' - - def _get_diff(self, cr, uid, ctx): - - """ @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - """ - - history = self.pool.get('wiki.wiki.history') - ids = ctx.get('active_ids') - diff = "" - if len(ids) == 2: - if ids[0] > ids[1]: - diff = history.getDiff(cr, uid, ids[1], ids[0]) - else: - diff = history.getDiff(cr, uid, ids[0], ids[1]) - - elif len(ids) == 1: - old = history.browse(cr, uid, ids[0]) - nids = history.search(cr, uid, [('wiki_id', '=', old.wiki_id.id)]) - nids.sort() - diff = history.getDiff(cr, uid, ids[0], nids[-1]) - else: - raise osv.except_osv(_('Warning'), _('You need to select minimum 1 or maximum 2 history revision!')) - return diff - - _columns = { - 'diff': fields.text('Diff'), - } - - _defaults = { - 'diff': _get_diff - } - -showdiff() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
