From fd8441d630bfe7d08fd89135b6391e405f42834e Mon Sep 17 00:00:00 2001 From: Chintan Ambaliya Date: Thu, 17 May 2018 12:56:12 +0530 Subject: [PATCH] [FIX] Warning 'website.menu.write() with unknown fields: className, style, text' and Fix Isuue: #69 --- addons/website/models/website.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/website/models/website.py b/addons/website/models/website.py index 9cb68a04..1bb4a949 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -981,7 +981,6 @@ class Menu(models.Model): if to_delete: self.browse(to_delete).unlink() for menu in data['data']: - del menu['is_homepage'] mid = menu['id'] # new menu are prefixed by new- if isinstance(mid, pycompat.string_types): @@ -995,6 +994,14 @@ class Menu(models.Model): menu['page_id'] = page.id elif menu_id.page_id: menu_id.page_id.write({'url': menu['url']}) + if 'is_homepage' in menu: + del menu['is_homepage'] + if 'className' in menu: + del menu['className'] + if 'style' in menu: + del menu['style'] + if 'text' in menu: + del menu['text'] menu_id.write(menu) return True