Community mailing list archives

community@mail.odoo.com

Re: stock.history total quantity and stock.quant total doesn't match

by
Aasim Ahmed Ansari
- 04/12/2016 08:40:48
Thanks Lionel. It's working fine now.

Virus-free. www.avast.com



--

Aasim Ahmed Ansari

Cell: +91 9619 424 386


On Wed, Apr 6, 2016 at 3:23 PM, Lionel Sausin <ls@numerigraphe.com> wrote:

stock_history is a bit dumb, you may have at least 2 problems with it:
- it's computed using all stock moves, which meas a single error long ago will provoke bad results
- does not take pack operations into account, so the locations reported are wrong if you use put away strategies or automatic reservations in sub-locations.

We've worked on the subject of valuation a bit lately (check https://github.com/numerigraphe/odoo/commit/d7f1fdfec9894b2081b6109bf2fca54145739511 for example).
It fixes the 1st problem, not the 2nd.

We could improve it further to fix the 2nd problem and make a clean module but we have nou funding for that.
If there is interest we may run a fundraiser.

Side note: if you're doing a *sales* dashboard you should probably not use the *inventory* history. They have nothing in common in Odoo.

Lionel.

Le 04/04/2016 11:17, aasim ansari a écrit :
Hello,

Based on my research, I feel output of the following 2 queries should be the same-
SELECT SUM(qty) FROM stock_quant WHERE product_id=%s AND location_id=%s GROUP BY product_id

SELECT SUM(quantity) FROM stock_history h WHERE h.product_id=%s AND h.location_id=%s GROUP BY h.product_id

However, for some products it is not. If I have missed anything do let me know.

I am developing comprehensive Daily Sales Report module and would like community's input in finding the best way out.

Thanks.

--

Aasim Ahmed Ansari

Cell: +91 9619 424 386

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe