Odoo Help


Generate invoice automatic when confirm sale in sales order

on 11/1/16, 5:00 AM 1,358 views

hi all i have a question,

how can i generate automatic invoice with state open when confirm sale in sales order

Product : Service

Create Invoice : on demand

Sales Invoicing : Generate invoice based on sales order

Now :

1. Create sales order

2. Save

3. Confirm Sale

4. Create Invoice

i want when confirm sale, invoice automatic generate

i have ovveride method like this

def _prepare_invoice(self, cr, uid, order, lines, context=None):
        obj_model = self.pool.get('ir.model')       

        obj_model_id = obj_model.search(cr,uid,[ ('model','=',self.__class__.__name__) ])       

         invoice = super(in_cabang_to_sale,self)._prepare_invoice(cr, uid, order, lines, context=context)                invoice.update({               


                                'model_id': obj_model_id[0],               



return invoice

def _make_invoice(self, cr, uid, order, lines, context=None):
        result = super(in_cabang_to_sale,self)._make_invoice(cr, uid, order, lines, context=context)                workflow.trg_validate(uid, 'account.invoice', result, 'invoice_open', cr)       

        return result

def action_ship_create(self, cr, uid, ids, context=None):
        res = super(in_cabang_to_sale,self).action_ship_create(cr, uid, ids, context=context)       

        self.signal_workflow(cr, uid, ids, 'manual_invoice')       

        return res

Anyone can help me? thanks before

On 11/2/16, 4:09 AM


Try installing this module .https://www.odoo.com/apps/modules/8.0/sale_automatic_workflow/https://www.odoo.com/apps/modules/8.0/sale_automatic_workflow/

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: 11/1/16, 5:00 AM
Seen: 1358 times
Last updated: 11/2/16, 4:09 AM