Odoo Help


how to create a custom field at delivery order (stock.picking.out) which gets its value from sales order in openerp?

on 9/14/14, 4:04 AM 2,509 views

I have a sales order form which contains a custom delivery date field.

Now I want to pass the value from delivery date field in sales order to the commitment date field in delivery order (stock.picking.out).

Did we make two columns in both stock.picking and stock.picking.out?

And also how can I take the delivery date field value from sales order during the automatic creation of delivery order(at the click of confirm order button).

I am using v7. Thanks in advance


Sudhir Arya (SA)

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

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow




Sudhir Arya (SA)
On 9/14/14, 6:29 AM

There is a method named _prepare_order_picking in sale.order model in sale_stock module that generates and returns a dictionary to creates delivery order.
You have to override that method and modify the dictionary as per your need.

class sale_order(osv.Model):
    _inherit = 'sale.order'

    def _prepare_order_picking(self, cr, uid, order, context=None):
        vals = super(sale_order, self)._prepare_order_picking(cr, uid, order, context=context)
        vals.update({'field_name': your_value})
        return vals

I guess this will solve your question.

thank you very much sudhir. its working.. :)

on 9/14/14, 9:05 AM

How is this done on v8? I tried this but doesn't work: def _prepare_order_line_procurement(self, cr, uid, order, line, group_id=False, context=None): res=super(sale_order, self)._prepare_order_line_procurement(cr, uid, order, line, group_id=False, context=context) return { 'client_order_ref': order.client_order_ref, }

Roberto Barreiro
on 12/19/14, 1:17 PM

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

2 follower(s)


Asked: 9/14/14, 4:04 AM
Seen: 2509 times
Last updated: 3/16/15, 8:10 AM