If you want to create multiple work-flows in single module in Odoo for that you have to follow below code-
<!-- Activity -->
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="Demo_expense_workflow"/>
<field name="flow_start">True</field>
<field name="kind">dummy</field>
<field name="name">draft</field>
</record>
<record id="act_submit" model="workflow.activity">
<field name="wkf_id" ref="Demo_expense_workflow"/>
<field name="kind">function</field>
<field name="action">expense_submit()</field>
<field name="name">submit</field>
</record>
<!-- Transistion -->
<record id="trans_draft_submit" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_submit"/>
<field name="signal">signal_submit</field>
</record>
<!-- Activity -->
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="demo_payment_workflow"/>
<field name="flow_start">True</field>
<field name="kind">dummy</field>
<field name="name">draft</field>
</record>
<record id="act_submit" model="workflow.activity">
<field name="wkf_id" ref="demo_payment_workflow"/>
<field name="kind">function</field>
<field name="action">expense_submit()</field>
<field name="name">submit</field>
</record>
<!-- Transistion -->
<record id="trans_draft_submit" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_submit"/>
<field name="signal">signal_submit</field>
</record>
Note- A workflow, one can attach conditions, signals, and triggers to transitions, so that the behavior of the workflow dependency upon other module.
0 Comment(s)