Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I'm using openERP 7 and I'm having following process for processing new customer orders.
1) Open Sales Order
2) From the Sales Order, create Delivery Order
3) Back to the Sales Order and create Invoice
So far this process worked. Now I have new customer, who wants to have in his invoice(step 3), the Delivery Order no.(that was crated in step 2).
The problem is that in sale.order model(db table sale_order) and account.invoice model(db table account_invoice) there is no reference to the delivery order id(db field stock.picking.name). I can't find a option to refer to the stock.picking.name for my sales order from the invoice template, when I modify it with OpenOffice Writer. I can get the o.origin, which returns only the Sales Order No, but from there I can't refer to the Delivery Order no, because it's not in sale.order model. How can I add the Delivery Order number to the Invoice? Has someone done that?
Looking forward to your replays! Thanks!
It apperas that this is possible with standard. I could acheive it by switching to odoo v8 and changing the process from the described in the question to Generate Sales Order -> Generate Delivery Order -> Generate Invoice(but from the Delivery Order page, not from the sales order. This solves my problem and the invoice in v8 has the delivery order item in the default template. Looks like I will have to switch to V8.
Currently there is no sure way for you to determine which invoice is created from which delivery order. If you check the _prepare_invoice methods from odoo/addons/stock/stock.py you'll see that the picking.name is stored into the account.invoice's name. But this can be overriden by other modules. If you what to be very sure, then create a many2many relationship between stock.picking and account.invoice and you can play around with the _invoice_hook or _prepare_invoice methods from stock.picking to populate the relationship. It is called when you clicked the Create Invoice button.
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 12/6/14, 11:33 AM|
|Seen: 3796 times|
|Last updated: 3/16/15, 8:10 AM|