On 14 May 15:45, Albert Cervera i Areny wrote:
> A great improvement would be to consider production delays too, but
> that carries a good amount of complexity in itself. Yet, maybe we
> could consider refactoring check_stock_quantity() to allow that
> improvement to be implemented by another module, which could take
> advantage of the stock calculated.

For now, Tryton doesn't have any information about production delay.
stock_supply_production just create request one day before the need.
I think it will be too much complex to try to compute when something can
be produced, instead I will be in favor of adding a production time just
like there is a delivery time.

> Another possible improvement I see is to just get the stock of those
> products marked as purchaseable. If I understand the code correctly
> those that are not purchaseable will get a supply date by
> get_supply_dates() which will never cause a warning. So no need to
> calculate their stock in the first place.

Yes this is wrong, we should not use PurchaseRequest.get_supply_dates
for none purchasable product.
Otherwise in case there is not supply dates, it is the opposite
of what you said, the check is always done.

I updated the codereview with those remarks.
-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Reply via email to