Created
September 13, 2018 16:16
-
-
Save josemoralesp/512ea9b1d8327de1319ec58eb2357bb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT | |
so.name, | |
p.name, | |
pt.name, | |
acc.name, | |
aml.credit, | |
aml.debit, | |
c.name, | |
aml.date | |
FROM | |
account_move_line AS aml | |
INNER JOIN | |
product_product AS pp ON pp.id = aml.product_id | |
INNER JOIN | |
product_template AS pt ON pt.id = pp.product_tmpl_id | |
INNER JOIN | |
res_currency AS c ON c.id = aml.currency_id | |
INNER JOIN | |
account_account AS acc ON acc.id = aml.account_id | |
INNER JOIN | |
res_partner AS p ON p.id = aml.partner_id | |
INNER JOIN | |
account_move AS am ON am.id = aml.move_id | |
LEFT OUTER JOIN | |
account_invoice AS ai ON ai.move_id = am.id | |
LEFT OUTER JOIN | |
account_invoice_line AS ail ON ail.invoice_id = ai.id | |
LEFT OUTER JOIN | |
sale_order_line_invoice_rel AS slrel ON slrel.invoice_line_id = ail.id | |
LEFT OUTER JOIN | |
sale_order_line AS sl ON sl.id = slrel.order_line_id | |
LEFT OUTER JOIN | |
sale_order AS so ON so.id = sl.order_id | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment