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

update state of delivery order using action_process method

By
Peter
on 12/8/14, 8:39 AM 707 views

Hello,

i am working on a module to set the status of a delivery order based on a csv input. 

I am using this code where delivery ID is the id of a specific delivery order:

 picking_pool = self.pool.get('stock.picking.out')

 

for delivery_order in picking_pool.browse(cr, uid, delivery_id):
                   delivery_order.action_process()
                   self.pool.get('activity.log').create_log(cr, uid, "delivery order: %s" % (delivery_order.name))

 

the script, if triggered, runs without any error, but the delivery order is not changed to delivered. Any ideas what's wrong?

Thanks  

Peter

0
Peter
On 12/8/14, 9:09 AM

thanks for the reply. I understand, but which method do I have to use to change the state of the delivery order? Or do i have to update the field state explicetly? 

You analyse method do_partial(). Change state of delivery order is associated with multiple operations. Usually one stock.picking is related to many stock.move. Additionaly change to this state generatses stock valutaions and accounts post. You need to perform several operations as easily as you want rather not be.

zbik
on 12/8/14, 12:20 PM

I got that. I have been trying around and obviously changing the states of delivery orders and subsequently of the move_line within the delivery order results in a state where delivery order and stock moves are shown correctly and the stock is updated correctly as well. However, I seem to be missing something, since the the respective deliveries in magento are not updated correclty via the connector. Checking do_partial() in stock_invoice_directly/stock_invoice.py does not really help since it seems to be more related to invoicing. Just copying these calls won't fix it i suppose... Can anyone help? Hoe can I actually get the information which function is actually called if i manually flag a delivery as shipped? I did not find any documentation on this topic... Thanks Peter

Peter
on 12/8/14, 1:18 PM
0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 12/8/14, 9:06 AM

Method action_process() is used only to open the partial picking wizard.

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: 12/8/14, 8:39 AM
Seen: 707 times
Last updated: 3/16/15, 8:10 AM