From 5679cb3f8abf312b79979a36fad5af99d221ffb2 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 31 Oct 2008 16:30:22 +0100 Subject: [PATCH] imprvoement bzr revid: fp@tinyerp.com-20081031153022-h2pxpydfqff7ms15 --- addons/crm/crm.py | 7 ++++++ addons/crm_configuration/crm_jobs_menu.xml | 26 +++++++++++----------- addons/crm_configuration/crm_jobs_view.xml | 9 ++++---- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 0289af0b8bc..fbd7de7526e 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -397,6 +397,13 @@ class crm_case(osv.osv): } _order = 'priority, date_deadline desc, date desc,id desc' + def unlink(self, cr, uid, ids, context={}): + for case in self.browse(cr, uid, ids, context): + if case.state <> 'draft': + raise osv.except_osv(_('Warning !'), + _('You can not delete this case. You should better cancel it.')) + return super(crm_case, self).unlink(cr, uid, ids, context) + def _action(self, cr, uid, cases, state_to, scrit=None, context={}): if not scrit: scrit = [] diff --git a/addons/crm_configuration/crm_jobs_menu.xml b/addons/crm_configuration/crm_jobs_menu.xml index f5b2075d8de..974e0960c31 100644 --- a/addons/crm_configuration/crm_jobs_menu.xml +++ b/addons/crm_configuration/crm_jobs_menu.xml @@ -14,7 +14,7 @@ crm.case tree,calendar,form,graph - + @@ -53,7 +53,7 @@ crm.case tree,calendar,form,graph - + @@ -86,7 +86,7 @@ crm.case form,tree - + @@ -111,7 +111,7 @@ crm.case tree,calendar,form,graph - + @@ -144,7 +144,7 @@ crm.case tree,calendar,form,graph - + @@ -181,7 +181,7 @@ crm.case tree,calendar,form,graph - + @@ -216,7 +216,7 @@ crm.case tree,calendar,form,graph - + @@ -251,7 +251,7 @@ crm.case calendar,tree,form,graph - + @@ -290,7 +290,7 @@ crm.case tree,calendar,form,graph - + @@ -323,7 +323,7 @@ crm.case tree,calendar,form,graph - + @@ -356,7 +356,7 @@ crm.case tree,calendar,form,graph - + @@ -389,7 +389,7 @@ crm.case tree,calendar,form,graph - + @@ -422,7 +422,7 @@ crm.case calendar,tree,form,graph - + diff --git a/addons/crm_configuration/crm_jobs_view.xml b/addons/crm_configuration/crm_jobs_view.xml index 9593bf4f1b2..ec1f5918b63 100644 --- a/addons/crm_configuration/crm_jobs_view.xml +++ b/addons/crm_configuration/crm_jobs_view.xml @@ -18,6 +18,7 @@ + @@ -34,7 +35,7 @@ -