From 4dd338391dc958af668e9e1941c44bba02417aec Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Thu, 21 Jan 2010 19:25:50 +0530 Subject: [PATCH 1/2] document_change: add the view for process type bzr revid: sbh@tinyerp.com-20100121135550-zp3ebm5ixlgxhuid --- addons/document_change/document_change.py | 15 ++++---- .../document_change/document_change_view.xml | 35 ++++++++++++++++++- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/addons/document_change/document_change.py b/addons/document_change/document_change.py index 3748c1bbc5e..9c5bf4a6674 100644 --- a/addons/document_change/document_change.py +++ b/addons/document_change/document_change.py @@ -34,7 +34,7 @@ class document_change_type(osv.osv): _description = "Document Change Type" _columns = { - 'name': fields.char("Document Change Type", size=64), + 'name': fields.char("Document Change Type", size=64,required=True), 'phase_type_ids': fields.many2many('document.change.process.phase.type','document_process__rel','type_id','change_id','Phase Type'), 'template_document_id':fields.many2one('ir.attachment','Document') } @@ -61,18 +61,19 @@ class doucment_change_process_phase(osv.osv): _description = "Document Change Process Phase" _columns = { - 'name': fields.char("Name", size=64), + 'name': fields.char("Name", size=64, required=True), 'process_id':fields.many2one('document.change.process','Process Change'), 'sequence': fields.integer('Sequence'), - 'update_document': fields.selection([('at_endPhase', 'At EndPhase'),('at_endprocess', 'At EndPorcess')], 'Update Document', required=True), - 'type': fields.selection([('required', 'Control Required'),('no_control', 'Control')], 'Type', required=True), + 'update_document': fields.selection([('at_endPhase', 'End Phase'),('at_endprocess', 'End Porcess')], 'Update Document', required=True), + 'type': fields.selection([('control_required', 'Control Required'),('no_control', 'No Control')], 'Type', required=True), 'date_control': fields.date('Control Date', select=True), 'phase_ids':fields.many2one('document.change.process.phase','Phase Type'), - 'state': fields.selection([('draft', 'Draft'),('started', 'Started'),('validate', 'To Validate'), ('end', 'End')], 'Status', readonly=True), + 'state': fields.selection([('draft', 'Draft'),('started', 'Started'),('validate', 'To Validate'), ('end', 'End')], 'Status'), 'phase_document_ids':fields.many2many('ir.attachment','phase_document_rel','phase_id','document_id','Document'), } _defaults = { 'state': lambda *a: 'draft', + 'type':lambda *a: 'no_control', } doucment_change_process_phase() @@ -93,7 +94,7 @@ 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', readonly=True), + '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'), } @@ -142,7 +143,7 @@ class doucment_change_process(osv.osv): 'create_date':fields.datetime('Creation',readonly=True), 'latest_modified_date':fields.function(_latestmodification, method=True, type='date', string="Lastest Modification"), #TODO no year! 'date_expected':fields.datetime('Expected Production'), - 'state':fields.selection([('draft', 'Draft'),('progress', 'Progress'),('confirmed', 'To Validate'), ('done', 'Done'),('done', 'Done'),('cancel','Cancelled')], 'Status', readonly=True), + 'state':fields.selection([('draft', 'Draft'),('progress', 'Progress'),('confirmed', 'To Validate'), ('done', 'Done'),('done', 'Done'),('cancel','Cancelled')], 'Status'), 'process_phase_ids':fields.one2many('document.change.process.phase','process_id','Phase'), 'process_document_ids': fields.many2many('ir.attachment','document_changed_process_rel','process_id','change_id','Document To Change'), 'pending_directory_id' :fields.many2one('document.directory','Pending Directory ID'), diff --git a/addons/document_change/document_change_view.xml b/addons/document_change/document_change_view.xml index bf9328363a5..09b0822d295 100644 --- a/addons/document_change/document_change_view.xml +++ b/addons/document_change/document_change_view.xml @@ -143,6 +143,39 @@ + + + document.change.process.type.form + document.change.process.type + form + +
+ + +
+
+ + + document.change.process.type.tree + document.change.process.type + tree + + + + + + + + + ir.actions.act_window + document.change.process.type + Process Type + form + tree,form + + + + @@ -296,7 +329,7 @@ - + From 88d3592b11027af438ff909d45206083220ccd9b Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Thu, 21 Jan 2010 19:32:45 +0530 Subject: [PATCH 2/2] document_change: set the required true bzr revid: sbh@tinyerp.com-20100121140245-50zya2s6g36pd8bq --- addons/document_change/document_change.py | 2 +- addons/document_change/document_change_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/document_change/document_change.py b/addons/document_change/document_change.py index 9c5bf4a6674..e3cac86b493 100644 --- a/addons/document_change/document_change.py +++ b/addons/document_change/document_change.py @@ -65,7 +65,7 @@ class doucment_change_process_phase(osv.osv): 'process_id':fields.many2one('document.change.process','Process Change'), 'sequence': fields.integer('Sequence'), 'update_document': fields.selection([('at_endPhase', 'End Phase'),('at_endprocess', 'End Porcess')], 'Update Document', required=True), - 'type': fields.selection([('control_required', 'Control Required'),('no_control', 'No Control')], 'Type', required=True), + 'type': fields.selection([('control_required', 'Control Required'),('no_control', 'No Control')], 'Type'), 'date_control': fields.date('Control Date', select=True), 'phase_ids':fields.many2one('document.change.process.phase','Phase Type'), 'state': fields.selection([('draft', 'Draft'),('started', 'Started'),('validate', 'To Validate'), ('end', 'End')], 'Status'), diff --git a/addons/document_change/document_change_view.xml b/addons/document_change/document_change_view.xml index 09b0822d295..273e0d2a638 100644 --- a/addons/document_change/document_change_view.xml +++ b/addons/document_change/document_change_view.xml @@ -329,7 +329,7 @@ - +