[IMP]: wiki: code optimization and apply csv file
bzr revid: ksa@tinyerp.co.in-20100317083608-6qoqjd0zdsfna8up
This commit is contained in:
parent
081026fa6a
commit
9336a7a278
|
@ -6,3 +6,7 @@
|
|||
"wiki_groups_link","wiki.groups.link","model_wiki_groups_link","base.group_system",1,1,1,1
|
||||
"wiki_wiki_history","wiki.wiki.history","model_wiki_wiki_history","base.group_user",1,0,1,0
|
||||
"wiki_wizard_wiki_history_show_diff","wizard.wiki.history.show_diff","model_wizard_wiki_history_show_diff","base.group_user",1,1,1,1
|
||||
"wiki_wiki_page_open","wiki.wiki.page.open","model_wiki_wiki_page_open","base.group_user",1,1,1,1
|
||||
"wiki_create_menu","wiki.create.menu","model_wiki_create_menu","base.group_user",1,1,1,1
|
||||
"wiki_wiki_help_open","wiki.wiki.help.open","model_wiki_wiki_help_open","base.group_user",1,1,1,1
|
||||
"wiki_make_index","wiki.make.index","model_wiki_make_index","base.group_user",1,1,1,1
|
||||
|
|
|
|
@ -27,71 +27,89 @@
|
|||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
import time
|
||||
from StringIO import StringIO
|
||||
from HTMLParser import HTMLParser
|
||||
import difflib
|
||||
|
||||
class Wiki(osv.osv):
|
||||
_name="wiki.wiki"
|
||||
""" wiki """
|
||||
|
||||
_name = "wiki.wiki"
|
||||
|
||||
Wiki()
|
||||
|
||||
class WikiGroup(osv.osv):
|
||||
""" Wiki Groups """
|
||||
|
||||
_name = "wiki.groups"
|
||||
_description="Wiki Groups"
|
||||
_description = "Wiki Groups"
|
||||
_order = 'name'
|
||||
_columns={
|
||||
|
||||
_columns = {
|
||||
'name':fields.char('Wiki Group', size=256, select=True, required=True),
|
||||
'page_ids':fields.one2many('wiki.wiki', 'group_id', 'Pages'),
|
||||
'notes':fields.text("Description"),
|
||||
'create_date':fields.datetime("Created Date", select=True),
|
||||
'template': fields.text('Wiki Template'),
|
||||
'section': fields.boolean("Make Section ?"),
|
||||
'method':fields.selection([('list','List'),('page','Home Page'),('tree','Tree')],'Display Method'),
|
||||
'method':fields.selection([('list', 'List'), ('page', 'Home Page'), \
|
||||
('tree', 'Tree')], 'Display Method'),
|
||||
'home':fields.many2one('wiki.wiki', 'Pages'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'method': lambda *a: 'page',
|
||||
}
|
||||
|
||||
WikiGroup()
|
||||
|
||||
|
||||
class GroupLink(osv.osv):
|
||||
""" Apply Group Link """
|
||||
|
||||
_name = "wiki.groups.link"
|
||||
_description="Wiki Groups Links"
|
||||
_description = "Wiki Groups Links"
|
||||
_rec_name = 'action_id'
|
||||
_columns={
|
||||
'group_id':fields.many2one('wiki.groups', 'Parent Group', ondelete='set null'),
|
||||
|
||||
_columns = {
|
||||
'group_id': fields.many2one('wiki.groups', 'Parent Group', ondelete='set null'),
|
||||
'action_id': fields.many2one('ir.ui.menu', 'Menu')
|
||||
}
|
||||
|
||||
GroupLink()
|
||||
|
||||
|
||||
class Wiki(osv.osv):
|
||||
_inherit="wiki.wiki"
|
||||
_description="Wiki Page"
|
||||
""" Wiki Page """
|
||||
|
||||
_inherit = "wiki.wiki"
|
||||
_description = "Wiki Page"
|
||||
_order = 'section,create_date desc'
|
||||
_columns={
|
||||
'name':fields.char('Title', size=256, select=True, required=True),
|
||||
'write_uid':fields.many2one('res.users',"Last Author"),
|
||||
'text_area':fields.text("Content"),
|
||||
'create_uid':fields.many2one('res.users','Author', select=True),
|
||||
'create_date':fields.datetime("Created on", select=True),
|
||||
'write_date':fields.datetime("Modification Date", select=True),
|
||||
'tags':fields.char('Tags', size=1024),
|
||||
'history_id':fields.one2many('wiki.wiki.history','wiki_id','History Lines'),
|
||||
'minor_edit':fields.boolean('Minor edit', select=True),
|
||||
'summary':fields.char('Summary',size=256),
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Title', size=256, select=True, required=True),
|
||||
'write_uid': fields.many2one('res.users',"Last Author"),
|
||||
'text_area': fields.text("Content"),
|
||||
'create_uid': fields.many2one('res.users','Author', select=True),
|
||||
'create_date': fields.datetime("Created on", select=True),
|
||||
'write_date': fields.datetime("Modification Date", select=True),
|
||||
'tags': fields.char('Tags', size=1024),
|
||||
'history_id': fields.one2many('wiki.wiki.history','wiki_id','History Lines'),
|
||||
'minor_edit': fields.boolean('Minor edit', select=True),
|
||||
'summary': fields.char('Summary',size=256),
|
||||
'section': fields.char('Sequence', size=32, help="Use page section code like 1.2.1"),
|
||||
'group_id':fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null'),
|
||||
'toc':fields.boolean('Table of Contents'),
|
||||
'group_id': fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null'),
|
||||
'toc': fields.boolean('Table of Contents'),
|
||||
'review': fields.boolean('Need Review'),
|
||||
'parent_id':fields.many2one('wiki.wiki', 'Parent Page'),
|
||||
'child_ids':fields.one2many('wiki.wiki', 'parent_id', 'Child Pages'),
|
||||
'parent_id': fields.many2one('wiki.wiki', 'Parent Page'),
|
||||
'child_ids': fields.one2many('wiki.wiki', 'parent_id', 'Child Pages'),
|
||||
}
|
||||
|
||||
def onchange_group_id(self, cr, uid, ids, group_id, content, context={}):
|
||||
|
||||
""" @param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of wiki page’s IDs
|
||||
@return : dictionay of open wiki page on give page section """
|
||||
|
||||
if (not group_id) or content:
|
||||
return {}
|
||||
grp = self.pool.get('wiki.groups').browse(cr, uid, group_id)
|
||||
|
@ -111,14 +129,24 @@ class Wiki(osv.osv):
|
|||
'section': section
|
||||
}
|
||||
}
|
||||
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
return super(Wiki, self).copy_data(cr, uid, id, {'wiki_id':False}, context)
|
||||
|
||||
""" @param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param id: Give wiki page's ID """
|
||||
|
||||
return super(Wiki, self).copy_data(cr, uid, id, {'wiki_id': False}, context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
id = super(Wiki,self).create(cr, uid, vals, context)
|
||||
|
||||
""" @param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks, """
|
||||
|
||||
id = super(Wiki,self).create(cr, uid, vals, context)
|
||||
history = self.pool.get('wiki.wiki.history')
|
||||
if vals.get('text_area'):
|
||||
res = {
|
||||
if vals.get('text_area'):
|
||||
res = {
|
||||
'minor_edit':vals.get('minor_edit', True),
|
||||
'text_area':vals.get('text_area',''),
|
||||
'write_uid':uid,
|
||||
|
@ -126,10 +154,14 @@ class Wiki(osv.osv):
|
|||
'summary':vals.get('summary','')
|
||||
}
|
||||
history.create(cr, uid, res)
|
||||
return id
|
||||
return id
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
result = super(Wiki,self).write(cr, uid, ids, vals, context)
|
||||
|
||||
""" @param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks, """
|
||||
|
||||
result = super(Wiki, self).write(cr, uid, ids, vals, context)
|
||||
history = self.pool.get('wiki.wiki.history')
|
||||
if vals.get('text_area'):
|
||||
for id in ids:
|
||||
|
@ -148,24 +180,30 @@ Wiki()
|
|||
|
||||
class History(osv.osv):
|
||||
""" Wiki History """
|
||||
_name="wiki.wiki.history"
|
||||
_description="Wiki History"
|
||||
_rec_name="date_time"
|
||||
|
||||
_name = "wiki.wiki.history"
|
||||
_description = "Wiki History"
|
||||
_rec_name = "date_time"
|
||||
_order = 'id DESC'
|
||||
_columns={
|
||||
'create_date':fields.datetime("Date",select=True),
|
||||
'text_area':fields.text("Text area"),
|
||||
'minor_edit':fields.boolean('This is a major edit ?',select=True),
|
||||
'summary':fields.char('Summary',size=256, select=True),
|
||||
'write_uid':fields.many2one('res.users',"Modify By", select=True),
|
||||
'wiki_id':fields.many2one('wiki.wiki','Wiki Id', select=True)
|
||||
|
||||
_columns = {
|
||||
'create_date': fields.datetime("Date",select=True),
|
||||
'text_area': fields.text("Text area"),
|
||||
'minor_edit': fields.boolean('This is a major edit ?',select=True),
|
||||
'summary': fields.char('Summary',size=256, select=True),
|
||||
'write_uid': fields.many2one('res.users',"Modify By", select=True),
|
||||
'wiki_id': fields.many2one('wiki.wiki','Wiki Id', select=True)
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'write_uid': lambda obj,cr,uid,context: uid,
|
||||
}
|
||||
|
||||
def getDiff(self, cr, uid, v1, v2, context={}):
|
||||
import difflib
|
||||
|
||||
""" @param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks, """
|
||||
|
||||
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']
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<menuitem id="base.menu_document2" name="Collaborative Content"
|
||||
parent="base.menu_document" />
|
||||
|
||||
<!-- Wiki Groups -->
|
||||
<!-- Wiki Groups Tree view -->
|
||||
|
||||
<record model="ir.ui.view" id="wiki_group_tree">
|
||||
<field name="name">wiki.groups.tree</field>
|
||||
|
@ -26,6 +26,9 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Wiki Groups Form view -->
|
||||
|
||||
<record model="ir.ui.view" id="wiki_group_form">
|
||||
<field name="name">wiki.groups.form</field>
|
||||
<field name="model">wiki.groups</field>
|
||||
|
@ -56,6 +59,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Wiki Groups Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_wiki_groups">
|
||||
<field name="name">Wikis</field>
|
||||
<field name="res_model">wiki.groups</field>
|
||||
|
@ -74,7 +79,7 @@
|
|||
<field name="view_type">tree</field>
|
||||
</record>
|
||||
|
||||
<!-- wiki -->
|
||||
<!-- wiki Tree view For child -->
|
||||
|
||||
<record id="view_wiki_tree_childs" model="ir.ui.view">
|
||||
<field name="name">wiki.wiki.tree.childs</field>
|
||||
|
@ -93,6 +98,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- wiki Tree view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_wiki_tree">
|
||||
<field name="name">wiki.wiki.tree</field>
|
||||
<field name="model">wiki.wiki</field>
|
||||
|
@ -109,6 +116,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- wiki Form view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_wiki_form">
|
||||
<field name="name">wiki.wiki.form</field>
|
||||
<field name="model">wiki.wiki</field>
|
||||
|
@ -134,6 +143,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- wiki Search view -->
|
||||
|
||||
<record id="view_wiki_filter" model="ir.ui.view">
|
||||
<field name="name">wiki.wiki.search</field>
|
||||
<field name="model">wiki.wiki</field>
|
||||
|
@ -181,7 +192,7 @@
|
|||
<field name="filter" eval="True"/>
|
||||
</record>
|
||||
|
||||
<!-- History -->
|
||||
<!-- History Tree view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_wiki_history_tree">
|
||||
<field name="name">wiki.wiki.history.tree</field>
|
||||
|
@ -197,6 +208,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- History Form view -->
|
||||
|
||||
<record model="ir.ui.view" id="wiki_history_form">
|
||||
<field name="name">wiki.wiki.history.form</field>
|
||||
<field name="model">wiki.wiki.history</field>
|
||||
|
@ -212,6 +225,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- History Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_history">
|
||||
<field name="name">All Page Histories</field>
|
||||
<field name="res_model">wiki.wiki.history</field>
|
||||
|
@ -235,7 +250,7 @@
|
|||
<field name="key2">tree_but_open</field>
|
||||
<field name="model">wiki.groups</field>
|
||||
<field name="name">Search a Page</field>
|
||||
<field eval="'ir.actions.wizard,%d'%wizard_open_page" name="value"/>
|
||||
<field eval="'ir.actions.wizard,%d'%action_view_wiki_wiki_page_open" name="value"/>
|
||||
<field eval="True" name="object"/>
|
||||
</record>
|
||||
</data>
|
||||
|
|
|
@ -22,9 +22,16 @@
|
|||
from osv import fields,osv
|
||||
|
||||
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 = ""
|
||||
|
@ -46,8 +53,11 @@ class showdiff(osv.osv_memory):
|
|||
_columns = {
|
||||
'diff': fields.text('Diff'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'diff': _get_diff
|
||||
}
|
||||
|
||||
showdiff()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -23,8 +23,10 @@ from osv import fields, osv
|
|||
|
||||
class wiki_create_menu(osv.osv_memory):
|
||||
""" Create Menu """
|
||||
|
||||
_name = "wiki.create.menu"
|
||||
_description = "Wizard Create Menu"
|
||||
|
||||
_columns = {
|
||||
'menu_name': fields.char('Menu Name', size=256, select=True, required=True),
|
||||
'menu_parent_id': fields.many2one('ir.ui.menu', 'Parent Menu', required=True),
|
||||
|
@ -32,6 +34,7 @@ class wiki_create_menu(osv.osv_memory):
|
|||
}
|
||||
|
||||
def wiki_menu_create(self, cr, uid, ids, context):
|
||||
|
||||
""" Create Menu On the base of Group id and Action id
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
|
@ -39,23 +42,22 @@ class wiki_create_menu(osv.osv_memory):
|
|||
|
||||
"""
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
action_id = mod_obj._get_id(cr, uid, 'wiki', 'action_view_wiki_wiki_page_open')
|
||||
for group in self.pool.get('wiki.groups').browse(cr, uid, ids):
|
||||
for menu in self.browse(cr, uid, ids):
|
||||
menu_id = self.pool.get('ir.ui.menu').create(cr, uid, {
|
||||
'name':menu.menu_name,
|
||||
'parent_id':menu.menu_parent_id.id,
|
||||
'icon': 'STOCK_DIALOG_QUESTION',
|
||||
'action': 'ir.actions.act_window,'+ str(action_id)
|
||||
}, context)
|
||||
home = menu.page.id
|
||||
group_id = menu.id
|
||||
res = {
|
||||
'home':home,
|
||||
}
|
||||
self.pool.get('wiki.groups').write(cr, uid, ids, res)
|
||||
self.pool.get('wiki.groups.link').create(cr, uid,
|
||||
{'group_id': group_id, 'action_id':menu_id})
|
||||
action_id = mod_obj._get_id(cr, uid, 'wiki','action_view_wiki_wiki_page_open')
|
||||
for menu in self.browse(cr, uid, ids):
|
||||
menu_id = self.pool.get('ir.ui.menu').create(cr, uid, {
|
||||
'name':menu.menu_name,
|
||||
'parent_id':menu.menu_parent_id.id,
|
||||
'icon': 'STOCK_DIALOG_QUESTION',
|
||||
'action': 'ir.actions.act_window,'+ str(action_id)
|
||||
}, context)
|
||||
home = menu.page.id
|
||||
group_id = menu.id
|
||||
res = {
|
||||
'home':home,
|
||||
}
|
||||
self.pool.get('wiki.groups').write(cr, uid, ids, res)
|
||||
self.pool.get('wiki.groups.link').create(cr, uid,
|
||||
{'group_id': group_id, 'action_id': menu_id})
|
||||
|
||||
return {}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Create Menu -->
|
||||
<!-- Create Menu From view -->
|
||||
|
||||
<record id="view_wiki_create_menu" model="ir.ui.view">
|
||||
<field name="name">Create Menu</field>
|
||||
|
@ -22,6 +22,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Create Menu Action -->
|
||||
|
||||
<record id="action_wiki_create_menu" model="ir.actions.act_window">
|
||||
<field name="name">Create Menu</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
|
|
@ -2,19 +2,19 @@
|
|||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
# 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
|
||||
# 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.
|
||||
# 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.
|
||||
# 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
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
@ -23,16 +23,16 @@ from osv import fields, osv
|
|||
|
||||
class wiki_make_index(osv.osv_memory):
|
||||
""" Create Index For Selected Page """
|
||||
|
||||
_name = "wiki.make.index"
|
||||
_description = "Create Index"
|
||||
_columns = {
|
||||
}
|
||||
|
||||
def wiki_do_index(self, cr, uid, ids, context):
|
||||
|
||||
""" Makes Index according to page hierarchy
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of wiki index’s IDs
|
||||
@param ids: list of wiki index’s IDs
|
||||
|
||||
"""
|
||||
data = context and context.get('active_ids', []) or []
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Create Index -->
|
||||
<!-- Create Index Form view -->
|
||||
|
||||
<record id="view_wiki_make_index" model="ir.ui.view">
|
||||
<field name="name">Create Index</field>
|
||||
|
@ -20,6 +20,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Create Index Action -->
|
||||
|
||||
<record id="action_view_wiki_make_index" model="ir.actions.act_window">
|
||||
<field name="name">Create Index</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -30,6 +32,8 @@
|
|||
<field name="context">{'record_id' : active_id}</field>
|
||||
</record>
|
||||
|
||||
<!-- Create Index Action Window -->
|
||||
|
||||
<act_window id="action_view_wiki_make_index_values"
|
||||
key2="client_action_multi" name="Create Index"
|
||||
res_model="wiki.make.index" src_model="wiki.wiki"
|
||||
|
|
|
@ -26,10 +26,9 @@ class wiki_wiki_help_open(osv.osv_memory):
|
|||
""" Basic Wiki Editing """
|
||||
_name = "wiki.wiki.help.open"
|
||||
_description = "Basic Wiki Editing"
|
||||
_columns = {
|
||||
}
|
||||
|
||||
def open_wiki_page(self, cr, uid, ids, context):
|
||||
|
||||
""" Opens Wiki Page for Editing
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Editing Page -->
|
||||
<!-- Editing Page Form view -->
|
||||
|
||||
<record id="view_wiki_wiki_help_open" model="ir.ui.view">
|
||||
<field name="name">Basic Wiki Editing</field>
|
||||
|
@ -17,6 +17,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Editing Page Action -->
|
||||
|
||||
<record id="action_view_wiki_wiki_help_open" model="ir.actions.act_window">
|
||||
<field name="name">Basic Wiki Editing</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -26,6 +28,8 @@
|
|||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- Editing Page Action window -->
|
||||
|
||||
<act_window id="action_view_wiki_wiki_help_open_vals"
|
||||
key2="client_action_multi" name="Basic Wiki Editing"
|
||||
res_model="wiki.wiki.help.open" src_model="wiki.wiki"
|
||||
|
|
|
@ -23,19 +23,19 @@ from osv import fields, osv
|
|||
|
||||
class wiki_wiki_page_open(osv.osv_memory):
|
||||
""" wizard Open Page """
|
||||
|
||||
_name = "wiki.wiki.page.open"
|
||||
_description = "wiz open page"
|
||||
_columns = {
|
||||
|
||||
}
|
||||
|
||||
def open_wiki_page(self, cr, uid, ids, context):
|
||||
|
||||
""" Opens Wiki Page of Group
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of open wiki page’s IDs
|
||||
@return : dictionay of open wiki window on give group id
|
||||
"""
|
||||
|
||||
for group in self.pool.get('wiki.groups').browse(cr, uid,ids):
|
||||
|
||||
value = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Open Page -->
|
||||
<!-- Open Page Form view -->
|
||||
|
||||
<record id="view_wiki_wiki_page_open" model="ir.ui.view">
|
||||
<field name="name">Open Page</field>
|
||||
|
@ -17,6 +17,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Open Page Action -->
|
||||
|
||||
<record id="action_view_wiki_wiki_page_open" model="ir.actions.act_window">
|
||||
<field name="name">Open Page</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -26,6 +28,8 @@
|
|||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- Open Page Action window -->
|
||||
|
||||
<act_window id="action_view_wiki_wiki_page_open_vals"
|
||||
key2="client_action_multi" name="Open Wiki Page"
|
||||
res_model="wiki.wiki.page.open" src_model="wiki.groups"
|
||||
|
|
Loading…
Reference in New Issue