Skip to Content
Menu
This question has been flagged
3 Replies
12595 Views

i want to get product stock on specific date like 

what is product stock 1st Jan 2019 

product stock <= 01-jan-2019 

same like date what is product stock at 

product stock <= 01-mar-2019


may i use this type of query 

product.with_context({'warehouse': warehouse}).qty_available  but where i can specify date ?????



Avatar
Discard

Hi! Does anyone know how that would work on odoo16? 
I am trying to find this exact information and I cannot.

Thank you!

checking the v16, source code, same method is expected to work, did you miss to pass the to_date in context

Best Answer

Hi,

In the context pass the date, rather than passing the warehouse if not necessary.

product.with_context({'to_date': date_val}).qty_available


If you check this menu and wizard, Inventory -> Reporting -> Inventory report, choose  At a specific date and click the button.



By checking the code of the button Retrieve Inventory Quantities you can see the sample.

Thanks

Avatar
Discard
Author

warehouse also necessary .....

Then pass both values simultaneously in the context

Best Answer

Hi Niyas Raphy! 
Thank you for your reply.
I am unable to try your solution because in my odoo I cannot access Inventory -> Reporting -> Inventory report.

I am usign a self-hosted odoo16 community.

This is what my inventory module looks like: (I cannot attach a picture bc I have not enough karma :(( )
In the "Reporting" tab, there are only the following sub-menus:
- Stock
- Locations
- Moves History
- Stock Moves
- Valuation

But not Inventory report.

How can I activate the Inventory report feature???

I couldn't find it anywhere in forums/official documentation/etc.

Thank you in advance!!

Avatar
Discard

Hi Maria,
the Report with the name "Inventory Report" (Odoo 14-15) was renamed to "Locations" with Odoo 16.

Hola,

Estoy de fuera de la oficina hasta el día 9 de octubre. Si tiene algún mensaje urgente, por favor escriba a contacto@bleta.io o llámenos al teléfono que aparece en nuestra web.

Gracias,
Best Answer

Hello,

This code doesn't work "product.with_context({'to_date': date_val}).qty_available".

It always return current stock inventory for selected product.

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 19
7451
4
Aug 24
5353
2
Apr 24
562
1
Mar 21
5071
1
Feb 21
2612