From 24b5ad43c95d38463407d50a7e0ebd8603e0bc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 9 Apr 2011 12:56:22 +0200 Subject: [PATCH 1/2] Add missing ondelete CASCADE to act_window --- dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard.py b/dashboard.py index 6982be94fe..451e6e17aa 100644 --- a/dashboard.py +++ b/dashboard.py @@ -11,7 +11,7 @@ class DashboardAction(ModelSQL, ModelView): select=1) sequence = fields.Integer('Sequence') act_window = fields.Many2One('ir.action.act_window', 'Action', - required=True) + required=True, ondelete='CASCADE') def __init__(self): super(DashboardAction, self).__init__() From 5275440a1ad7a512b648d5886af4082367dbc247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 9 Apr 2011 13:52:38 +0200 Subject: [PATCH 2/2] Don't allow to use board act_window in dashboard for issue1924 --- dashboard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard.py b/dashboard.py index 451e6e17aa..9cd4a6295a 100644 --- a/dashboard.py +++ b/dashboard.py @@ -11,7 +11,10 @@ class DashboardAction(ModelSQL, ModelView): select=1) sequence = fields.Integer('Sequence') act_window = fields.Many2One('ir.action.act_window', 'Action', - required=True, ondelete='CASCADE') + required=True, ondelete='CASCADE', domain=[ + ('res_model', '!=', False), + ('res_model', '!=', ''), + ]) def __init__(self): super(DashboardAction, self).__init__()