Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
11609 Lượt xem

Hi,

I am coding a module who need to generate an invoice from nearly nothing , the problem is how do i do it in python ? Is there an example in the standard modules ?

thanks

edit: i am developing an openerp module not some external soft

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

This is a simple exemple to generate invoice:

invoice_id = self.pool.get('account.invoice').create(cr,uid,{
    'date_invoice' : '2013-04-04',
    'partner_id' : 144,
    ...
    your values here
    ...
    })

This code generate an invoice and return the id.

Ảnh đại diện
Huỷ bỏ
Tác giả

ok, thanks

Câu trả lời hay nhất

There are many ways to do that. First thing that comes to my mind is using oerplib, the other is with web-services.

Then I would take a look at the code for creating invoices in the sales and account modules. Specially study what the account_invoice.py in the account module does. The information you need in order to create an invoice from 0 is there

Ảnh đại diện
Huỷ bỏ
Tác giả

i edited my question

well, take a look at the account_invoice.py module

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 12 23
7126
1
thg 8 20
11977
9
thg 8 18
7715
1
thg 3 18
4979
1
thg 3 15
9793