[IMP] wiki: minor improvements to usability

bzr revid: odo@openerp.com-20100630151935-cfri7cvs1z6jxvfq
This commit is contained in:
Olivier Dony 2010-06-30 17:19:35 +02:00
parent b3b0e20219
commit 1b171756d1
4 changed files with 21 additions and 45 deletions

View File

@ -32,7 +32,6 @@ import difflib
class Wiki(osv.osv):
""" wiki """
_name = "wiki.wiki"
Wiki()
@ -78,7 +77,7 @@ class GroupLink(osv.osv):
GroupLink()
class Wiki(osv.osv):
class Wiki2(osv.osv):
""" Wiki Page """
_inherit = "wiki.wiki"
@ -87,19 +86,22 @@ class Wiki(osv.osv):
_columns = {
'name': fields.char('Title', size=256, select=True, required=True),
'write_uid': fields.many2one('res.users', "Last Author"),
'write_uid': fields.many2one('res.users', "Last Author", select=True),
'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),
'tags': fields.char('Tags', size=1024, select=True),
'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'),
'review': fields.boolean('Need Review'),
'section': fields.char('Section', size=32, help="Use page section code like 1.2.1", select=True),
'group_id': fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null',
help="Topic, also called Wiki Group"),
'toc': fields.boolean('Table of Contents',
help="Indicates that this pages is a table of contents (linking to other pages)"),
'review': fields.boolean('Needs Review', select=True,
help="Indicates that this page should be reviewed, raising the attention of other contributors"),
'parent_id': fields.many2one('wiki.wiki', 'Parent Page'),
'child_ids': fields.one2many('wiki.wiki', 'parent_id', 'Child Pages'),
}
@ -176,29 +178,7 @@ class Wiki(osv.osv):
history.create(cr, uid, res)
return result
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 users ID for security checks,
@param ids: List of wiki pages IDs
"""
pages = self.pool.get('wiki.wiki').search(cr, uid, [('name', '=', 'Basic Wiki Editing')])
if not pages:
raise osv.except_osv(_('Warning !'), _("No Help page is defined"))
value = {
'view_type': 'form',
'view_mode': 'form,tree',
'res_model': 'wiki.wiki',
'view_id': False,
'res_id': pages[0],
'type': 'ir.actions.act_window',
'nodestroy': True,
}
return value
Wiki()
Wiki2()
class History(osv.osv):

View File

@ -123,14 +123,9 @@
<field name="arch" type="xml">
<form string="Wiki">
<group col="8" colspan="4">
<field name="name" select="1" colspan="6"/>
<button name="open_wiki_page" type="object"
string="Basic Wiki Editing" icon="gtk-ok" />
</group>
<group col="8" colspan="4">
<field name="name" select="1" colspan="8"/>
<field name="group_id" string="Topic" select="1" on_change="onchange_group_id(group_id, text_area)"/>
<field name="section" invisible="not context.get('section',False)"/>
<!-- <field name="parent_id"/>-->
</group>
<notebook colspan="4">
<page string="Content">
@ -144,7 +139,6 @@
<field name="review" select="1"/>
<field name="tags" select="1" groups="base.group_extended"/>
<field name="toc"/>
<!-- <field name="summary" colspan="4" groups="base.group_extended"/>-->
</group>
</form>
</field>
@ -165,7 +159,6 @@
<field name="group_id" select="1"/>
<field name="write_uid" select="1"/>
<field name="write_date" select="1"/>
<field name="review" select="1"/>
<newline/>
<group expand="0" string="Group By..." colspan="8" col="6">
<filter icon="terp-check" string="Wiki Group" domain="[]" context="{'group_by':'group_id'}"/>

View File

@ -9,9 +9,11 @@
== Answer ==
== External Links ==
</field>
</field>
</record>
<record id="wiki_wiki_bugs" model="wiki.wiki">
<field name="name">Bug Tracker ?</field>
@ -48,8 +50,7 @@ Integration Benefits:
* The Open ERP Website: [http://openerp.com]
* The DMS Documentation: [http://openerp.com]
</field>
</field>
</record>
<record id="wiki_wiki_dms" model="wiki.wiki">
<field name="name">Document Management System ?</field>
@ -88,8 +89,7 @@ Integration Benefits:
* The Open ERP Website : [http://openerp.com]
* The DMS Documentation : [http://openerp.com]
</field>
</field>
</record>
</data>
</openerp>

View File

@ -14,11 +14,14 @@
<field eval="2" name="section"/>
<field name="template">== Question ==
== Answer ==
== External Links ==
</field>
</field>
</record>