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):