Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Openerp workflow button not displaying

By
Swan
on 7/2/16, 3:08 PM 305 views

I have edited wkf_holidays workflow in Holiday Leave Management Module. I needed to add a addtional valdation in between confirmed and validation and I edited out. I can see the node and new node in the existing workflow but the thing is validation button is missing and after the confirm it's not directing to my new node sub_confirm. Please help me out

workflow:

request leave--> confirm --> sub validate --> validate 1 --> validate2 --> approved

new node : sub_confirm

in workflow file I put call this new node block after the confirm

<record model="workflow.activity" id="act_sub_confirm"> <!-- submit2-->
        <field name="wkf_id" ref="wkf_holidays" />
        <field name="name">sub_confirm</field>
        <field name="kind">function</field>
        <field name="action">act_sub_confirm()</field>
        <field name="split_mode">OR</field>
    </record>

Transition

<record model="workflow.transition" id="holiday_confirm2validate"> <!-- 2. submitted->accepted (validate signal) if not double_validation-->
        <field name="act_from" ref="act_confirm" />
        <field name="act_to" ref="act_sub_confirm" />
        <field name="signal">validate</field>
        <field name="condition">not double_validation</field>
        <field name="group_id" ref="base.group_hr_user"/>
    </record>

    <!--new transition-->
    ***<record model="workflow.transition" id="holiday_sub2validate1"> <!-- 2. submitted -> first_accepted (validate signal) if double_validation-->
        <field name="act_from" ref="act_sub_confirm" />
        <field name="act_to" ref="act_validate1" />
        <field name="signal">validate</field>
        <field name="condition">double_validation</field>
        <field name="group_id" ref="base.group_hr_user"/>
    </record>***

    <record model="workflow.transition" id="holiday_confirm2validate1"> <!-- 2. submitted -> first_accepted (validate signal) if double_validation-->
        <field name="act_from" ref="act_confirm" />
        <field name="act_to" ref="act_validate1" />
        <field name="signal">validate</field>
        <field name="condition">double_validation</field>
        <field name="group_id" ref="base.group_hr_user"/>
    </record>

Button call in hr_holidays_view.xml file

<button string="Sub Confirm" name="sub_confirm" states="sub_confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="sub_confirm,draft,confirm,validate" statusbar_colors='{"sub_confirm":"blue","confirm":"blue","validate1":"blue","refuse":"red"}'/>

Transition function in hr_holidays.py file

def act_sub_confirm(self, cr, uid, ids, context=None):

        res=self.write(cr, uid, ids, {'state':'sub_confirm'}, context=context)
        return res

Please help me to understand what I have done wrong.

0
Asmita Chavan
On 7/8/16, 8:49 AM

In workflow transition with id=holiday_confirm2validate1, I guess you have misplaced the workflow activities.

        <field name="act_from" ref="act_confirm" />
        <field name="act_to" ref="act_validate1" />

In above activity as per my understanding of workflow, you should put:

<field name="act_from" ref="act_validate1" />
<field name="act_to" ref="act_confirm">

try this.

I hope this works ...

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/2/16, 3:08 PM
Seen: 305 times
Last updated: 7/8/16, 8:49 AM