Odoo Help


Change state to custom new state in stock.picking Odoo 8

on 12/22/15, 8:46 PM 1,623 views

I'm using odoo 8 and already added new state "On Delivery" to stock.picking model.

How can i change the state from the Default state "Ready to Transfer" to my new state "On Delivery" ?

Already try using self.write(cr,uid,ids,{'state':'on_delivery'}), not working. 

write method (inherit stock.picking):

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

        self.write(cr, uid, ids, {'state':'on_delivery'}) #change state to On Delivery in Odoo

        return True

Also modified the existing workflow, not working as well

workflow approach(sale.order.basic):

<?xml version="1.0" encoding="utf-8"?>



        <record id="act_delivery" model="workflow.activity">

            <field name="wkf_id" ref="sale.wkf_sale"/>

            <field name="name">OnDelivery</field>

            <field name="kind">function</field>

            <field name="action">do_delivery()</field>


        <record id="trans_ship_delivery" model="workflow.transition">

            <field name="act_from" ref="sale.act_ship"/>

            <field name="act_to" ref="act_delivery"/>

            <field name="signal">do_delivery_button</field>


        <record id="trans_ship_delivered" model="workflow.transition">

            <field name="act_from" ref="act_delivery"/>

            <field name="act_to" ref="sale.act_ship_end"/>




Any helps? 

Thanks in advance.

I think that the correct change in the workflow would give a success result. Pls provide us with the changes you did in the workflow so one can lend a hand

Tarek Mohamed Ibrahim
on 12/22/15, 11:38 PM

Updated the questions. Include write method and workflow.

on 12/22/15, 11:44 PM

any news?

on 1/19/16, 8:01 PM
On 1/21/16, 3:19 AM

I just used cr.execute to change the state.

Many thanks.

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

1 follower(s)


Asked: 12/22/15, 8:46 PM
Seen: 1623 times
Last updated: 1/21/16, 3:19 AM