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.

2

workflow stock.picking.base [Closed]

By
klacus
on 4/18/13, 2:37 AM 3,466 views

The Question has been closed

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

Hi.

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>

and

        <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>
    </record>

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.

3

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

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>
</record>

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"/>

or

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

or

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

klacus
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.

klacus
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>
    </record>

It's looks like works. Thanks again.

klacus
on 4/18/13, 3:39 AM

Most welcome. :)

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

About This Community

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

Question tools

0 follower(s)

Stats

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