Add mrp operation process

bzr revid: pso@tinyerp.com-20081229100933-p6rcs3zojcso0hxo
This commit is contained in:
pso (tiny) 2008-12-29 15:39:33 +05:30
parent a16111269b
commit a4a6343ac7
3 changed files with 120 additions and 3 deletions

View File

@ -55,7 +55,8 @@
"demo_xml" : ["mrp_operation_data.xml"],
"update_xml" : [
"security/ir.model.access.csv",
"mrp_operations_workflow.xml","mrp_operations_view.xml","mrp_operations_report.xml"
"mrp_operations_workflow.xml","mrp_operations_view.xml","mrp_operations_report.xml",
"process/mrp_operation_process.xml"
],
"active": False,
"installable": True

View File

@ -47,14 +47,14 @@ class mrp_production_workcenter_line(osv.osv):
'date_planned': fields.related('production_id', 'date_planned', type='datetime', string='Date Planned'),
'date_start': fields.datetime('Start Date'),
'date_finnished': fields.datetime('End Date'),
'delay': fields.float('Delay',size=128,help="This is delay between operation start and stop in this workcenter",readonly=True),
'delay': fields.char('Delay',size=128,help="This is delay between operation start and stop in this workcenter",readonly=True),
'product':fields.related('production_id','product_id',type='many2one',relation='product.product',string='Product'),
'qty':fields.related('production_id','product_qty',type='float',string='Qty'),
'uom':fields.related('production_id','product_uom',type='many2one',relation='product.uom',string='UOM'),
}
_defaults = {
'state': lambda *a: 'draft',
'delay': lambda *a: 0.0
'delay': lambda *a: '0 Days 0 hrs and 0 mins'
}
def modify_production_order_state(self,cr,uid,ids,action):

View File

@ -0,0 +1,116 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_mrpoperationworkflow0" model="process.process">
<field eval="&quot;&quot;&quot;Mrp Operation Workflow&quot;&quot;&quot;" name="name"/>
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="1" name="active"/>
</record>
<!--
Process Node
-->
<record id="process_node_productionorder0" model="process.node">
<field name="menu_id" ref="mrp.menu_mrp_production_action"/>
<field name="model_id" ref="mrp.model_mrp_production"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Production order for any products&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Production Order&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationworkflow0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_workorder0" model="process.node">
<field name="menu_id" ref="menu_mrp_production_operation_action"/>
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Production Work Center&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Work Center&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationworkflow0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_startoperation0" model="process.node">
<field name="menu_id" ref="menu_mrp_production_operation_action"/>
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Operation is started&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Start Operation&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationworkflow0"/>
<field eval="&quot;&quot;&quot;object.state=='startworking'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_doneoperation0" model="process.node">
<field name="menu_id" ref="menu_mrp_production_operation_action"/>
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Operation is done&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Done Operation&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationworkflow0"/>
<field eval="&quot;&quot;&quot;object.state=='done'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_canceloperation0" model="process.node">
<field name="menu_id" ref="menu_mrp_production_operation_action"/>
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Operation is cancelled&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Cancel Operation&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationworkflow0"/>
<field eval="&quot;&quot;&quot;object.state=='cancel'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_productionstart0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Production start Operation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;From production order, create the workorder&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_startoperation0"/>
<field model="process.node" name="source_node_id" ref="process_node_productionorder0"/>
</record>
<record id="process_transition_workstartoperation0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Work start Operation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;From work order, define the cycles and hour for creating product&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_startoperation0"/>
<field model="process.node" name="source_node_id" ref="process_node_workorder0"/>
</record>
<record id="process_transition_startdoneoperation0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Start Done Operation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Operation is done&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_doneoperation0"/>
<field model="process.node" name="source_node_id" ref="process_node_startoperation0"/>
</record>
<record id="process_transition_startcanceloperation0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Start Cancel Operation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Operation is cancelled&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_canceloperation0"/>
<field model="process.node" name="source_node_id" ref="process_node_startoperation0"/>
</record>
</data>
</openerp>