تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5518 أدوات العرض

Hello, i'm on Odoo 8

I want to get my products and the locations of these products in a SQL query, to put it in a jrxml file (for Jasper report).

What is the link between stock.location and product.product (or product template) ?
I didn't found location_id in product_product or product template. 

I saw this in addons/stock/product.py :

'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one'),

I don't know if i can use this.

الصورة الرمزية
إهمال
أفضل إجابة

Hi Thomas: 

This information is stored in stock.quant in Odoo 12. Check whether this same model exists in Odoo 8.

الصورة الرمزية
إهمال
الكاتب

Hello, thank you for your answer !

I saw stock quant many times in code but i never understand what it is concretely, can you explain me please?

This is the model used to display the Inventory Report (Inventory > Reporting > Inventory Report). Odoo keeps a track of the reserved qty and the qty on hand by product, company, location in this model.

الكاتب

I will see this model, thank you !

المنشورات ذات الصلة الردود أدوات العرض النشاط
18
يونيو 21
29244
16
يناير 21
17420
1
يناير 21
8830
0
أكتوبر 17
4304
1
مايو 16
3808