From f611508bfe48a8723cc09f8dab9d271fe94f5c8c Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Mon, 21 Mar 2011 14:57:55 +0530 Subject: [PATCH 1/6] [FIX] WIKI: Wiki Pages Application error after clicking on Create Index lp bug: https://launchpad.net/bugs/736102 fixed bzr revid: aag@tinyerp.co.in-20110321092755-p2yx10ijm36rmevp --- addons/wiki/wizard/wiki_make_index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/wiki/wizard/wiki_make_index.py b/addons/wiki/wizard/wiki_make_index.py index 1e2dae8f92d..6cf26f663b7 100644 --- a/addons/wiki/wizard/wiki_make_index.py +++ b/addons/wiki/wizard/wiki_make_index.py @@ -38,7 +38,10 @@ 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 \ From db2df372eed50fdf549cfb8ae771722223ba7ed5 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Tue, 22 Mar 2011 17:35:29 +0530 Subject: [PATCH 2/6] [FIX] WIKI: Wiki Pages Application Now got warning if Section is not Define- Create Index lp bug: https://launchpad.net/bugs/736102 fixed bzr revid: aag@tinyerp.co.in-20110322120529-we7lgl23t7fvrnw0 --- addons/wiki/wizard/wiki_make_index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/wiki/wizard/wiki_make_index.py b/addons/wiki/wizard/wiki_make_index.py index 6cf26f663b7..7deb674c35c 100644 --- a/addons/wiki/wizard/wiki_make_index.py +++ b/addons/wiki/wizard/wiki_make_index.py @@ -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 """ @@ -47,6 +48,8 @@ class wiki_make_index(osv.osv_memory): 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 = {} From 2b6d4c6c28e8a0249a99dcafa2f11d4b7ea9dae9 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Wed, 23 Mar 2011 15:17:15 +0530 Subject: [PATCH 3/6] [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 --- addons/wiki/wizard/wiki_make_index.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) From 4f4bf7d34fe5c689c175993bbebc71b2bd038160 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Wed, 23 Mar 2011 15:24:56 +0530 Subject: [PATCH 4/6] [FIX] WIKI: Wiki Pages Application Now got warning if in Section charecter avalable22- Create Index lp bug: https://launchpad.net/bugs/736102 fixed bzr revid: aag@tinyerp.co.in-20110323095456-ciclodma2ws7pdr6 --- addons/wiki/wizard/wiki_make_index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/wiki/wizard/wiki_make_index.py b/addons/wiki/wizard/wiki_make_index.py index 9048e9423bb..90528652587 100644 --- a/addons/wiki/wizard/wiki_make_index.py +++ b/addons/wiki/wizard/wiki_make_index.py @@ -56,7 +56,7 @@ class wiki_make_index(osv.osv_memory): if check: for i in check: - match = re.match('[a-zA-Z]', i[0]) + 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 = [] From 1b466d4a9de28eb81ede0c28b526266ab1eb53ea Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Wed, 23 Mar 2011 18:18:33 +0530 Subject: [PATCH 5/6] [FIX] WIKI: Wiki Pages Application Now got warning if in Section charecter avalable33- Create Index lp bug: https://launchpad.net/bugs/736102 fixed bzr revid: aag@tinyerp.co.in-20110323124833-bo7gurieys58jzmk --- addons/wiki/wizard/wiki_make_index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/wiki/wizard/wiki_make_index.py b/addons/wiki/wizard/wiki_make_index.py index 90528652587..effb9023b4a 100644 --- a/addons/wiki/wizard/wiki_make_index.py +++ b/addons/wiki/wizard/wiki_make_index.py @@ -56,8 +56,8 @@ class wiki_make_index(osv.osv_memory): if check: for i in check: - match = re.match('[a-zA-Z_%-+$*&^#@!]', i[0]) - if match: + match = re.match('[0-9]', i[0]) + if not match: raise osv.except_osv(_('Warning !'), _('The section values must be like 1/1.1/1.3.4')) lst = [] s_ids = {} From 9e6718db9eb09db6d21e3db985dcc6c7a612e8b0 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Wed, 23 Mar 2011 18:43:52 +0530 Subject: [PATCH 6/6] [FIX] WIKI: Wiki Pages Application Now get warning id not proper formate lp bug: https://launchpad.net/bugs/736102 fixed bzr revid: aag@tinyerp.co.in-20110323131352-wv3chvlt0w7aquj8 --- addons/wiki/wizard/wiki_make_index.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/addons/wiki/wizard/wiki_make_index.py b/addons/wiki/wizard/wiki_make_index.py index effb9023b4a..95dc2a7e9cd 100644 --- a/addons/wiki/wizard/wiki_make_index.py +++ b/addons/wiki/wizard/wiki_make_index.py @@ -52,13 +52,10 @@ class wiki_make_index(osv.osv_memory): 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('[0-9]', i[0]) - if not match: - raise osv.except_osv(_('Warning !'), _('The section values must be like 1/1.1/1.3.4')) + for i in lst0[0][1]: + match = re.match('[0-9\.]', i) + if not match: + raise osv.except_osv(_('Warning !'), _('The section values must be like 1/1.1/1.3.4')) lst = [] s_ids = {}