summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMantavya Gajjar <mga@tinyerp.com>2008-11-24 13:22:15 +0530
committerMantavya Gajjar <mga@tinyerp.com>2008-11-24 13:22:15 +0530
commite73f4dfd6d79dfd14e23e3c2059e2ea7f4fb2a4d (patch)
treeec76de97f604e0af103e1b8b688f166a9925f054 /addons
parent2e4230ae7c4cc5e3742a91803d618795a5bee091 (diff)
implement
* differance wizard to show diff between 2 history lines bzr revid: mga@tinyerp.com-20081124075215-7bhiqoyc6vray2bg
Diffstat (limited to 'addons')
-rw-r--r--addons/wiki/__terp__.py1
-rw-r--r--addons/wiki/wizard/__init__.py3
-rw-r--r--addons/wiki/wizard/create_menu.py4
-rw-r--r--addons/wiki/wizard/show_diff.py50
-rw-r--r--addons/wiki/wizard/wizard_view.xml25
5 files changed, 80 insertions, 3 deletions
diff --git a/addons/wiki/__terp__.py b/addons/wiki/__terp__.py
index b42cb542b1e..f78d78955d6 100644
--- a/addons/wiki/__terp__.py
+++ b/addons/wiki/__terp__.py
@@ -14,6 +14,7 @@
"demo_xml" : [],
"update_xml" : [
"wiki_view.xml",
+ "wizard/wizard_view.xml",
"security/ir.model.access.csv"
],
"active": False,
diff --git a/addons/wiki/wizard/__init__.py b/addons/wiki/wizard/__init__.py
index 2d0a1a53130..ee734cd9600 100644
--- a/addons/wiki/wizard/__init__.py
+++ b/addons/wiki/wizard/__init__.py
@@ -1 +1,2 @@
-import create_menu \ No newline at end of file
+import create_menu
+import show_diff \ No newline at end of file
diff --git a/addons/wiki/wizard/create_menu.py b/addons/wiki/wizard/create_menu.py
index 2b6c4df8e64..93507afeab2 100644
--- a/addons/wiki/wizard/create_menu.py
+++ b/addons/wiki/wizard/create_menu.py
@@ -38,7 +38,7 @@ section_fields = {
'menu_parent_id': {'string':'Parent Menu', 'type':'many2one', 'relation':'ir.ui.menu', 'required':True},
}
-def report_menu_create(self, cr, uid, data, context):
+def wiki_menu_create(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
group = pool.get('wiki.groups').browse(cr, uid, data['id'])
@@ -65,7 +65,7 @@ class wizard_create_menu(wizard.interface):
'result': {'type':'form', 'arch':section_form, 'fields':section_fields, 'state':[('end','Cancel'),('create_menu','Create Menu')]}
},
'create_menu': {
- 'actions': [report_menu_create],
+ 'actions': [wiki_menu_create],
'result': {
'type':'state',
'state':'end'
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 (<http://tiny.be>). 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+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
diff --git a/addons/wiki/wizard/wizard_view.xml b/addons/wiki/wizard/wizard_view.xml
new file mode 100644
index 00000000000..2fa562b8aec
--- /dev/null
+++ b/addons/wiki/wizard/wizard_view.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_wiki_history_diff" model="ir.ui.view">
+ <field name="name">Wiki Differance</field>
+ <field name="model">wizard.wiki.history.show_diff</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="History Differance">
+ <separator string="Wiki Differance" colspan="4"/>
+ <field name="diff" widget="html_tag" nolabel="1" colspan="4"/>
+ </form>
+ </field>
+ </record>
+
+ <act_window
+ id="act_view_diff"
+ name="View Differance"
+ res_model="wizard.wiki.history.show_diff"
+ src_model="wiki.wiki.history"
+ target="new"
+ view_mode="form"
+ />
+ </data>
+</openerp> \ No newline at end of file