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 have written a sql query for return sale order records which are all in (type of on delivery order),they all are deliverd and invoiced.In report there must be date invoice fields also required against particular sale order(only when that sale order is in done state).I have descibed my sql query for your reference:
so.partner_id as partner_id,
pt.name as product,
sol.product_uom_qty as qty,
(case when so.state='done' then ai.date_invoice end) as date_invoice
from sale_order_line sol
left join sale_order so on so.id=sol.order_id
left join product_product pp on pp.id=sol.product_id
left join product_template pt on pt.id = pp.product_tmpl_id
left join stock_picking sp on sp.sale_id=so.id
left join res_partner res on res.id=so.partner_id
left join account_invoice ai on ai.origin = so.name
For sale order there is only link between sale order and account invoice is origin field.But it didnt worked properly.For some records the query didnt returned date invoice(only date invoice field is required from account_invoice table).So plese friends help me in this situation.Thanks in Advance.
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 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: 4/27/15, 7:53 AM|
|Seen: 1210 times|
|Last updated: 6/8/15, 9:26 AM|