I Am Creating Workflow for Approve Account button in odoo 10 i tried a lot but is not working can anyone tell me whats wrong with this code
Here is my code for creating Transition and activity
<record id="wkf_model_setting" model="workflow">
<field name="name">Name</field>
<field name="osv">model</field>
<field name="on_create">True</field>
</record>
<!--Activity -->
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_model_setting"/>
<field name="flow_start">True</field>
<field name="name">draft</field>
<field name="kind">function</field>
<field name="action">write({'state':'draft'})</field>
</record>
<record id="act_approved" model="workflow.activity">
<field name="name">approval</field>
<field name="wkf_id" ref="wkf_model_setting"/>
<field name="kind">function</field>
<field name="action">do_approval()</field>
</record>
<record id="trans_awaiting_approved" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_approved"/>
<field name="signal">button_approval</field>
<field name="group_id" ref="PE_ADMIN"/>
</record>
and defination for do_approval is like this
@api.multi
def do_approval(self):
#TODO: Check if user has rights
self.state ='approved'