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

CHANGE SALE WORKFLOW

By
Guido Orejuela Cataño
on 8/4/15, 12:57 PM 616 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

0

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 ?

Thanks


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

0

Grover Menacho

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

Systems Engineer + MBA

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

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

2 follower(s)

Stats

Asked: 8/4/15, 12:57 PM
Seen: 616 times
Last updated: 8/5/15, 11:10 AM