Skip to Content
Menu
This question has been flagged
1 Reply
6149 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

Avatar
Discard
Best Answer

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/


Avatar
Discard
Related Posts Replies Views Activity
1
Dec 22
4102
2
Jun 20
2745
5
Jan 20
6986
1
Nov 17
2856
1
Jun 17
6260