Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
5 Odpovědi
2302 Zobrazení

Hello,


I am new to ODOO and I have the following queries:


1- I would like to create postgreSQL queries or directly in Microsoft ACCESS via an ODBC connection that I already have configured.


Can someone give me the most important sales tables and their relationships?


       - Sales documents

       - Detail of sales lines

                - with sales price, cost price, batch number of the product sold

       - Table of third parties, articles, commercials, payment methods, risk, ...



2- Has anyone created SQL queries (mainly for sales) to pass to me so I don't waste a lot of time testing?


3- my final idea is after creating the queries that I mentioned above, connect them with POWER BI.


Does anyone have any POWER BI development already done?

Avatar
Zrušit
Nejlepší odpověď

Hello Jose

How did you solve sql queries to create powerbi report?


Avatar
Zrušit
Autor Nejlepší odpověď

Hi Mayur,


thank you very much for your response.


Could you help me with the following query:

I want to obtain the orders invoiced with the sales lines:

- Invoice number

- Customer

- Article

- sale price

- Cost price (or Margin)

- batch number of the item sold.


I have thought about linking [account_move] with [sale_order] and [sale_order_line], to extract the sales lines, which I have achieved but my question is for this example:

   ++I have an order with 2 sales lines

   ++I have invoiced the two lines separately in 2 invoices

Where do I find the information (field filter) to know that this order line has gone to invoice 1 and the other order line has gone to invoice 2?


many tks

Avatar
Zrušit
Nejlepší odpověď

Hi Jose, 


Basic PSQL query is here. 

select * from public.sale_order a LEFT JOIN public.sale_order_line b on a.id = b.order_id where a.name =xxxx (Replace order number);


You may required to explore more tables and join them.

- stock_picking (sale_order.id = stock.picking.sale_id)

- stock_move (stock_picking.id = stock_move.picking_id) (sale_order.name = stock_move.origin)

Stock Move Line table  will provide detailed info of lot number and final quantities with status done.

-stock_move_line (stock_move.id = stock_move_line.move_id) 

- account_move (Invoice information) (journal_id = pick the journal id from your system)

http://localhost:0000/web#cids=2%2C3%2C1&menu_id=114&action=236&model=account.journal&view_type=list

- account_move_line (Invoice lines)



Avatar
Zrušit
Nejlepší odpověď

Hi Jose, 

I specialise in creating Power BI reports for Odoo using Techneith's direct connector. If you want to check out my portfolio you can find it at bepbi.com 

All of the reports showcased have been created using the Odoo data model, so the relationships have already been established. Some require joins from over 20 tables. If you need any assistance, I would love to help. If not, I'd definitely recommend checking out Techneith's connector if you want to create the reports yourself. 

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
kvě 25
1632
0
úno 25
1650
2
led 25
8319
2
led 24
10138
7
led 24
49140