From f4041834ab19111a80c4e84701d50f65a6ff8850 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 22 Jan 2010 11:29:09 +0530 Subject: [PATCH] document_change: Add the action of docuement workflow bzr revid: sbh@tinyerp.com-20100122055909-iybm50kgj5rtawc9 --- addons/document_change/document_change.py | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/addons/document_change/document_change.py b/addons/document_change/document_change.py index 0b248289469..3de8f5e391e 100644 --- a/addons/document_change/document_change.py +++ b/addons/document_change/document_change.py @@ -102,6 +102,30 @@ class document_file(osv.osv): _defaults = { 'state': lambda *a: 'validate', } + def button_change_request(self, cr, uid, ids, context={}): + for document in self.browse(cr, uid, ids, context): + if document.target_document_id: + self.write(cr, uid, ids, {'state':'change_proposed'}) + else: + self.write(cr, uid, ids, {'state':'change_request'}) + return True + def button_change_proposed(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'change_proposed'}) + return True + def button_in_production(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state':'in_production'}) + return True + def button_to_update(self, cr, uid, ids, context={}): +# for document in self.browse(cr, uid, ids, context): +# if document.target_document_id: + self.write(cr, uid, ids, {'state':'to_update'}) + return True + def button_cancel(self, cr, uid, ids, context={}): + workflow = netsvc.LocalService('workflow') + for oid in ids: + workflow.trg_create(uid, self._name, oid, cr) + return self.write(cr, uid, ids, {'state':'to_cancel'},context=context) + document_file() class document_change_process_type(osv.osv):