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

Generate invoice automatic when confirm sale in sales order

By
Susi
on 11/1/16, 5:00 AM 164 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({               

                                'cabang':order.cabang.id,               

                                'model_id': obj_model_id[0],               

                                'transaction_id':order.id,               

                                })              

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

1
Sarga
On 11/2/16, 4:09 AM

Hi,

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/


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