From 205c8f6ea7e451354fade7a83c54ed64382ec9e6 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 21 Nov 2011 18:01:15 +0530 Subject: [PATCH 01/58] [IMP] mrp_operations: Improved work orders to initialize the workflow for demo data and existing records. bzr revid: uco@tinyerp.com-20111121123115-3plhb42u04ye9ipj --- addons/mrp_operations/mrp_operation_data.xml | 3 +++ addons/mrp_operations/mrp_operations.py | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/addons/mrp_operations/mrp_operation_data.xml b/addons/mrp_operations/mrp_operation_data.xml index 7ce25b6d250..2d0694f12ac 100644 --- a/addons/mrp_operations/mrp_operation_data.xml +++ b/addons/mrp_operations/mrp_operation_data.xml @@ -30,5 +30,8 @@ done + + + diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 7dc93731b03..e4815fee4c6 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -552,6 +552,17 @@ class mrp_operations_operation(osv.osv): return super(mrp_operations_operation, self).create(cr, uid, vals, context=context) + def initialize_workflow_instance(self, cr, uid, context=None): + wf_service = netsvc.LocalService("workflow") + wc_line_obj = self.pool.get('mrp.production.workcenter.line') + prod_obj = self.pool.get('mrp.production') + production_ids = prod_obj.search(cr, uid, [], context=context) + for op in prod_obj.browse(cr, uid, production_ids, context=context): + wc_lines = wc_line_obj.search(cr, uid, [('production_id','=',op.id)], context=context) + for line_id in wc_lines: + wf_service.trg_create(uid, 'mrp.production.workcenter.line', line_id, cr) + return True + _columns={ 'production_id':fields.many2one('mrp.production','Production',required=True), 'workcenter_id':fields.many2one('mrp.workcenter','Work Center',required=True), From eaebfd814d76a4767040d49e819a959fb89379f3 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 21 Nov 2011 18:31:53 +0530 Subject: [PATCH 02/58] [IMP] mrp_operations: Some usability improvements mentioned on pad. bzr revid: uco@tinyerp.com-20111121130153-re5blfwujjwjvqy6 --- addons/mrp_operations/mrp_operations.py | 4 ++-- addons/mrp_operations/mrp_operations_view.xml | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index e4815fee4c6..74d4ee3cf8a 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -86,10 +86,10 @@ class mrp_production_workcenter_line(osv.osv): _order = "sequence, date_planned" _columns = { - 'state': fields.selection([('draft','Draft'),('startworking', 'In Progress'),('pause','Pause'),('cancel','Cancelled'),('done','Finished')],'State', readonly=True, + 'state': fields.selection([('draft','Draft'),('startworking', 'In Progress'),('pause','Pending'),('cancel','Cancelled'),('done','Finished')],'State', readonly=True, help="* When a work order is created it is set in 'Draft' state.\n" \ "* When user sets work order in start mode that time it will be set in 'In Progress' state.\n" \ - "* When work order is in running mode, during that time if user wants to stop or to make changes in order then can set in 'Pause' state.\n" \ + "* When work order is in running mode, during that time if user wants to stop or to make changes in order then can set in 'Pending' state.\n" \ "* When the user cancels the work order it will be set in 'Canceled' state.\n" \ "* When order is completely processed that time it is set in 'Finished' state."), 'date_start_date': fields.function(_get_date_date, string='Start Date', type='date'), diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index 377a57d6121..e7decebbf4b 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -16,7 +16,7 @@