document_change: Add the action of docuement workflow
bzr revid: sbh@tinyerp.com-20100122055909-iybm50kgj5rtawc9
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user