Odoo Help


workflow stock.picking.base [Closed]

on 4/18/13, 2:37 AM 4,336 views

The Question has been closed

Sudhir Arya (SA)
on 04/18/2013 05:21:21


I want to add new activity for the standard stock.picking workflow. The problem is the I cannot define the wkf id, because not clear for me the name spaces.

I tried the following

        <record id="stock.act_validate" model="workflow.activity">
        <field name="wkf_id" ref="wkf_stock"/>
        <field name="name">validate</field>
        <field name="flow_stop">False</field>
        <field name="kind">function</field>
        <field name="action">action_done_valid()</field>


        <record id="stock.act_validate" model="workflow.activity">
        <field name="wkf_id" ref="stock.stock_picking_basic"/>
        <field name="name">validate</field>
        <field name="flow_stop">False</field>
        <field name="kind">function</field>
        <field name="action">action_done_valid()</field>

and this variants. The results is always some similar:

No such external ID currently defined in the system: csysc_stock_merge_picking.wkf_stock

I understand what is the problem, but how can tell to Openerp I want to add the element in wkf.activity table where the id is equal with stock.picking.basic.

May be the problem is with the dots. When I try to add Like this

<field name="wkf_id" ref="stock.stock.picking.basic"/>

Openerp always say, they need just 2 items not four.

ValueError: too many values to unpack

I am totally lost in space, how to define the workflow to the system, if I want to add or inherit.

Sudhir Arya (SA)
On 4/18/13, 2:52 AM

Its because wkf_stock does not exist in your module.

You want to add workflow in stock.picking then try this:

<record id="act_validate" model="workflow.activity">
    <field name="wkf_id" ref="stock.wkf_picking"/>
    <field name="name">validate</field>
    <field name="flow_stop">False</field>
    <field name="kind">function</field>
    <field name="action">action_done_valid()</field>

Here, wkf_picking is ID of stock.picking workflow.

You can use any external ID by model_name.record_id. Like we have used stock.wkf_picking.

You can find it at Stock Picking Workflow.

First of all, thanks for your reply!

In case of transition is must be the same?
<record id="trans_move_done" model="workflow.transition"> <field name="act_from" ref="stock.act_validate"/>


<record id="trans_move_done" model="workflow.transition"> <field name="act_from" ref="stock.wkf_picking"/>


<record id="stock.trans_move_done" model="workflow.transition"> <field name="act_from" ref="stock.act_validate"/> ?

on 4/18/13, 3:00 AM

You mean you want to overwrite transition which is already exists in stock?

Sudhir Arya (SA)
on 4/18/13, 3:08 AM

Yes, some need to be rewrite, and some new be add, and some old need to be delete.

on 4/18/13, 3:11 AM

See my updated answer. you can overwrite any id by using model_name.record_id.

This one is correct: <record id="stock.trans_move_done" model="workflow.transition"> <field name="act_from" ref="stock.act_validate"/>

Sudhir Arya (SA)
on 4/18/13, 3:16 AM

Thank you for your helping! Now All is ok!

remove by:

<delete id="stock.trans_move_done" model="workflow.transition"/>

modify by:

    <record id="trans_move_done" model="workflow.transition">
        <field name="act_from" ref="act_validate"/>
        <field name="act_to" ref="stock.act_done"/>
        <field name="condition">test_finished()</field>

It's looks like works. Thanks again.

on 4/18/13, 3:39 AM

Most welcome. :)

Sudhir Arya (SA)
on 4/18/13, 3:43 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/18/13, 2:37 AM
Seen: 4336 times
Last updated: 3/16/15, 8:10 AM