Odoo Help



Guido Orejuela Cataño
on 8/4/15, 12:57 PM 1,266 views

I want to do the following in sales order

1. I have a field in sale order lines called serial_number

2. when I save the order, it must be confirmed automatically and create the delivery of the product with the field serial_number registered in sale order line

Some idea ?

Thanks so much


Hi Grover, I copied this code from action_button_confirm in addons/sale and obtain assertion error

do you could you tell me what is wrong ?


class sale_order(osv.osv):

_inherit = "sale.order"

_columns = {

'coddebug':fields.integer('Codigo Debug'),


def create(self, cr, uid, vals, context=None):

    if not context:

        context = {}

    assert len(vals) == 1, 'This option should only be used for a single id at a time.'

    context['coddebug'] = 1

    if context.get('send_email'):

        self.force_quotation_send(cr, uid, vals, context=context)

    new_id = super(sale_order, self).create(cr, uid, vals, context=context)

    self.signal_workflow(cr, uid, vals, 'order_confirm')

    return new_id


Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Odoo Developer

Grover Menacho
On 8/4/15, 3:51 PM

Hello Guido.

You have to override the create function, and you can send:

signal_workflow(cr, uid, [order.id], 'order_confirm')

Then you have to override the _prepare_order_line_procurement

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: 8/4/15, 12:57 PM
Seen: 1266 times
Last updated: 8/5/15, 11:10 AM