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

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
Zrušit

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

Nejlepší odpověď

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
Zrušit
Autor

warehouse also necessary .....

Then pass both values simultaneously in the context

Nejlepší odpověď

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
Zrušit

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,
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
srp 19
8563
4
srp 24
6545
2
dub 24
2065
1
bře 21
6210
1
úno 21
3631