From bbeb226478e6afb8eaa9ca115434095fe4887b39 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 25 Jan 2010 16:55:26 +0530 Subject: [PATCH] document_change: modify the workflow check add the role based on type bzr revid: sbh@tinyerp.com-20100125112526-e3aq6mc3lhpkbq33 --- addons/document_change/document_change.py | 5 +++++ addons/document_change/document_phase_workflow.xml | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/document_change/document_change.py b/addons/document_change/document_change.py index f86ae49bfe1..f964725ce58 100644 --- a/addons/document_change/document_change.py +++ b/addons/document_change/document_change.py @@ -96,6 +96,11 @@ class doucment_change_process_phase(osv.osv): def do_done(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state':'done'}) return True + def test_control_request(self, cr, uid, ids, context=None): + return all(bool(process.type) =='control_required' for process in self.browse(cr, uid, ids, context=context)) + + def test_nocontrol_request(self, cr, uid, ids, context=None): + return all(bool(process.type) =='no_control' for process in self.browse(cr, uid, ids, context=context)) doucment_change_process_phase() diff --git a/addons/document_change/document_phase_workflow.xml b/addons/document_change/document_phase_workflow.xml index 02f2cc1679b..ea59fc2abe4 100644 --- a/addons/document_change/document_phase_workflow.xml +++ b/addons/document_change/document_phase_workflow.xml @@ -38,12 +38,20 @@ button_start - + + test_control_request() button_confirm + + + + test_nocontrol_request() + button_confirm + +