Odoo Help


Generate a new invoice by code

on 4/4/13, 11:58 AM 3,845 views


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 ?


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

Francesco OpenCode
On 4/4/13, 1:11 PM

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

on 4/4/13, 1:22 PM
On 4/4/13, 12:08 PM

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

on 4/4/13, 12:23 PM

well, take a look at the account_invoice.py module

on 4/4/13, 12:35 PM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 4/4/13, 11:58 AM
Seen: 3845 times
Last updated: 11/23/17, 5:51 AM