summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraag (OpenERP) <aag@tinyerp.co.in>2011-03-23 15:17:15 +0530
committeraag (OpenERP) <aag@tinyerp.co.in>2011-03-23 15:17:15 +0530
commit2b6d4c6c28e8a0249a99dcafa2f11d4b7ea9dae9 (patch)
treef731820cc044ea5aba0f0f0658ff0c869d816062
parentdb2df372eed50fdf549cfb8ae771722223ba7ed5 (diff)
[FIX] WIKI: Wiki Pages Application Now got warning if in Section charecter avalable- Create Index
lp bug: https://launchpad.net/bugs/736102 fixed bzr revid: aag@tinyerp.co.in-20110323094715-cvsypmap2yssqf1o
-rw-r--r--addons/wiki/wizard/wiki_make_index.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/wiki/wizard/wiki_make_index.py b/addons/wiki/wizard/wiki_make_index.py
index 7deb674c35c..9048e9423bb 100644
--- a/addons/wiki/wizard/wiki_make_index.py
+++ b/addons/wiki/wizard/wiki_make_index.py
@@ -21,6 +21,7 @@
from osv import fields, osv
from tools.translate import _
+import re
class wiki_make_index(osv.osv_memory):
""" Create Index For Selected Page """
@@ -50,6 +51,14 @@ class wiki_make_index(osv.osv_memory):
lst0 = cr.fetchall()
if not lst0[0][1]:
raise osv.except_osv(_('Warning !'), _('There is no section in this Page'))
+
+ check = map(lambda x: x.split('.'), lst0[0][1])
+
+ if check:
+ for i in check:
+ match = re.match('[a-zA-Z]', i[0])
+ if match:
+ raise osv.except_osv(_('Warning !'), _('The section values must be like 1/1.1/1.3.4'))
lst = []
s_ids = {}
@@ -81,7 +90,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)