[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
This commit is contained in:
xmo-odoo
2015-10-02 15:36:13 +02:00
parent 7352b34f0d
commit 249d0215c6
+1 -1
View File
@@ -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']: