summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-06-30 15:13:52 +0200
committerChristophe Matthieu <chm@odoo.com>2015-06-30 15:13:52 +0200
commit3e0d7e6664fe7016b44e4b0e9706266887316812 (patch)
treebc3a54532e8ead778c9f8d7e2eb8d1b1b528a97d /addons
parent2562ad523e025a382b754631e8707ac7317d4e5f (diff)
[FIX] website: can't create twice the same page because there are a infinity loop
Diffstat (limited to 'addons')
-rw-r--r--addons/website/models/website.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website/models/website.py b/addons/website/models/website.py
index 4ec308d65cd..a84ca04acf3 100644
--- a/addons/website/models/website.py
+++ b/addons/website/models/website.py
@@ -206,8 +206,8 @@ class website(osv.osv):
# find a free xmlid
inc = 0
- dom = [('key', '=', page_xmlid), '|', ('website_id', '=', False), ('website_id', '=', context.get('website_id'))]
- while view.search(cr, openerp.SUPERUSER_ID, dom, context=dict(context or {}, active_test=False)):
+ dom = [('website_id', '=', False), ('website_id', '=', context.get('website_id'))]
+ while view.search(cr, openerp.SUPERUSER_ID, [('key', '=', page_xmlid), '|'] + dom, context=dict(context or {}, active_test=False)):
inc += 1
page_xmlid = "%s.%s" % (template_module, page_name + (inc and "-%s" % inc or ""))
page_name += (inc and "-%s" % inc or "")