[MERGE] lp:736102 (removed the useless test on section structure as 1.A is acceptable as section name)

bzr revid: qdp-launchpad@openerp.com-20110324133350-vk19kkk8qqr7ups4
This commit is contained in:
Quentin (OpenERP) 2011-03-24 14:33:50 +01:00
commit b92b3efce2
1 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,7 @@
##############################################################################
from osv import fields, osv
from tools.translate import _
class wiki_make_index(osv.osv_memory):
""" Create Index For Selected Page """
@ -38,12 +39,18 @@ class wiki_make_index(osv.osv_memory):
if context is None:
context = {}
data = context and context.get('active_ids', []) or []
if not data:
return {'type': 'ir.actions.act_window_close'}
for index_obj in self.browse(cr, uid, ids, context=context):
wiki_pool = self.pool.get('wiki.wiki')
cr.execute("Select id, section from wiki_wiki where id IN %s \
order by section ", (tuple(data),))
lst0 = cr.fetchall()
if not lst0[0][1]:
raise osv.except_osv(_('Warning !'), _('There is no section in this Page'))
lst = []
s_ids = {}
@ -75,7 +82,6 @@ class wiki_make_index(osv.osv_memory):
current = current[:pos + 1]
if pos == len(l) - 1:
break
key = ('.'.join([str(x) for x in l]))
id = s_ids[key]
val = ('.'.join([str(x) for x in current[:]]), id)