Odoo Help

Welcome!

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.

0

Generate a new invoice by code

By
aze
on 4/4/13, 11:58 AM 2,785 views

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

2

Francesco OpenCode

--Francesco OpenCode--
3608
| 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

aze
on 4/4/13, 1:22 PM
0

Gustavo

--Gustavo--
950
| 2 1 4
Buenos Aires, Argentina
--Gustavo--

Python developer, big fan of sailing

Gustavo
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

aze
on 4/4/13, 12:23 PM

well, take a look at the account_invoice.py module

Gustavo
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)

Stats

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