Odoo Help


How to confirm a delivery order from sale order screen ?

on 6/27/14, 6:38 AM 1,165 views

How to confirm a devilery order (reduce stocks in location) from confirm sale button in sale order screen. I tried from sale order inherits and call a stock function from sale order. but i couldnt do it. give me solution.

I want to reduce a stock once i press confirm sale button. How to by-pass delivery workflow ?

I tried with following code,

stock_pick_obj = self.pool.get('stock.picking.out')
stock_move_obj = self.pool.get('stock.move')


wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', picking.id, 'button_confirm', cr)

 stock_move_obj.action_confirm(cr, uid, move_idds, context=context)
 wf_service.trg_validate(uid, 'stock.picking', picking.id, 'button_done', cr)



On 6/27/14, 9:36 AM

i found a solution for confirming a delivery order from sale order confirm button.Here i shared the code for achieving this,

Inherit a existing workflow and add a follwong lines,

                picking = stock_pick_obj.browse(cr, uid, pick_id)
                wf_service = netsvc.LocalService("workflow")
                wf_service.trg_validate(uid, 'stock.picking', picking.id, 'button_confirm', cr)
                self.pool.get('stock.move').force_assign(cr, uid, move_idds)
                wf_service.trg_write(uid, 'stock.picking',picking.id, cr)
                self.pool.get('stock.picking').action_move(cr, uid, [picking.id], context=context)
                wf_service.trg_validate(uid, 'stock.picking', picking.id, 'button_done', cr)

Give any other solutions if you have to achieve better than this.




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 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: 6/27/14, 6:38 AM
Seen: 1165 times
Last updated: 3/16/15, 8:10 AM