跳至內容
選單
此問題已被標幟
1 回覆
7716 瀏覽次數

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

頭像
捨棄
最佳答案

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/


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
12月 22
5720
2
6月 20
4066
5
1月 20
8438
1
11月 17
4000
1
6月 17
7778