How to obtain outgoing qty of a product in a given date (sale_rental)

Edgar Fernandez

I'm using sale_rental in Odoo v.8 and I want to extend the sale order function the following way:

Currently, the module raises a warning when there's not enough stock by counting all the pending Outgoing orders in warehouse. But, if I want to make a quotation in the future, the module wouldn't know that the product is back and available on that date and would show the warning.

How can I query the quantity ordered in a particular date for a product?