Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
11653 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
ผู้เขียน

ok, thanks

คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

i edited my question

well, take a look at the account_invoice.py module

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ธ.ค. 23
7205
1
ส.ค. 20
12020
9
ส.ค. 18
7743
1
มี.ค. 18
5013
1
มี.ค. 15
9837