diff --git a/addons/document_change/document_change.py b/addons/document_change/document_change.py
index fafa9c08b9e..792c4ce29d4 100644
--- a/addons/document_change/document_change.py
+++ b/addons/document_change/document_change.py
@@ -111,29 +111,30 @@ class document_file(osv.osv):
_columns = {
'type_id':fields.many2one('document.change.type','Document Type'),
- 'state': fields.selection([('change_request', 'Change Request'),('change_proposed', 'Change Proposed'), ('in_production', 'In Production'), ('to_update', 'To Update'), ('validate', 'To Validate'), ('cancel', 'Cancel')], 'Status'),
- 'target_document_id': fields.many2one('document.directory', 'Target Document'),
- 'target':fields.binary('Target'),
+ 'state': fields.selection([('in_production', 'In Production'), ('requested', 'Change Request'),('proposed', 'Change Proposed'), ('validated', 'To Validate'), ('cancel', 'Cancel')], 'State'),
+ 'target_directory_id': fields.many2one('document.directory', 'Target Document'),
+ 'target_document_id':fields.binary('Target'),
}
_defaults = {
- 'state': lambda *a: 'change_request',
+ 'state': lambda *a: 'in_production',
}
- def state_set_request(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'change_request'},context=context)
+ def do_request(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'requested'},context=context)
return True
- def state_set_proposed(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'change_proposed'},context=context)
- return True
- def state_set_in_production(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'in_production'})
- return True
- def state_set_update(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'to_update'})
- return True
- def state_set_validated(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'validate'},context=context)
- return True
- def state_set_cancel(self, cr, uid, ids, context={}):
+
+ def do_propose(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'proposed'},context=context)
+ return True
+
+ def do_validate(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'validated'},context=context)
+ return True
+
+ def do_production(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'in_production'},context=context)
+ return True
+
+ def do_cancel(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'cancel'},context=context)
document_file()
diff --git a/addons/document_change/document_change_view.xml b/addons/document_change/document_change_view.xml
index e631d58d6db..de6b80b69f8 100644
--- a/addons/document_change/document_change_view.xml
+++ b/addons/document_change/document_change_view.xml
@@ -232,16 +232,15 @@
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
diff --git a/addons/document_change/document_change_workflow.xml b/addons/document_change/document_change_workflow.xml
index 0c74d95d254..7c4be03e54f 100644
--- a/addons/document_change/document_change_workflow.xml
+++ b/addons/document_change/document_change_workflow.xml
@@ -8,72 +8,73 @@
-
+
True
- state_set_request
-
-
-
- change_proposed
- state_set_proposed()
- function
-
-
-
- to_update
- state_set_update()
- function
-
-
-
in_production
- state_set_in_production()
+ do_production()
+
+
+
+ requested
+ do_request()
function
-
+
- cancel
- state_set_cancel()
+ proposed
+ do_propose()
function
+
+
+ validated
+ do_validate()
+ function
+
+
+
+ cancel
+ do_cancel()
+ function
+
+
+
+
+ button_request
+
-
-
- button_change_proposed
+
+
+ button_propose
(target_document_id != False)
-
-
+
+
button_cancel
-
-
-
- button_change_validated
+
+
+
+ button_validate
-
-
+
+
button_cancel
-
-
- button_change_request
-
-
-
-
- button_update
-
-
-
-
- button_change_request
+
+
+ button_request
+
+
+
+ True
+
-
\ No newline at end of file
+