From 249d0215c6c2ee06ce3bcaf54a0df5c7efe2e244 Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Fri, 2 Oct 2015 15:36:13 +0200 Subject: [PATCH] [FIX] website: saving new menu items simplejson and the builtin json module apparently differ in how they decide to optimise decoding JSON strings to str rather than unicode python strings, so check for basestring rather than one or the other. This may also depend on the Python version. Closes #8726 --- addons/website/models/website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/website.py b/addons/website/models/website.py index f0c73c61b2f..cb18b26acf0 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -627,7 +627,7 @@ class website_menu(osv.osv): self.unlink(cr, uid, to_delete, context=context) for menu in data['data']: mid = menu['id'] - if isinstance(mid, str): + if isinstance(mid, basestring): new_id = self.create(cr, uid, {'name': menu['name']}, context=context) replace_id(mid, new_id) for menu in data['data']: