Odoo Help


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


Generate a new invoice by code

on 4/4/13, 11:58 AM 2,695 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

--Francesco OpenCode--
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

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


| 2 1 4
Buenos Aires, Argentina

Python developer, big fan of sailing

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 4/4/13, 11:58 AM
Seen: 2695 times
Last updated: 3/16/15, 8:10 AM