Tryton - Issues

 

Issue8703

Title stock_forecast creates moves in the past
Priority bug Status resolved
Superseder Nosy List albertca, ced, reviewbot, roundup-bot
Type behavior Components stock_supply_forecast
Assigned To ced Keywords review
Reviews 272251002
View: 272251002

Created on 2019-10-03.00:55:32 by albertca, last changed by roundup-bot.

Messages
New changeset e19cb8ea533a by Cédric Krier in branch '5.2':
Do not compute moves in the past and always return a list
https://hg.tryton.org/modules/stock_forecast/rev/e19cb8ea533a

New changeset f257e1d73220 by Cédric Krier in branch '5.0':
Do not compute moves in the past and always return a list
https://hg.tryton.org/modules/stock_forecast/rev/f257e1d73220
New changeset bf440054e23c by Cédric Krier in branch 'default':
Update scenario quantity for new behavior of stock forecast
https://hg.tryton.org/tryton-env/rev/bf440054e23c
New changeset ccbdb5d0e6fe by Cédric Krier in branch 'default':
Update scenario quantity for new behavior of stock forecast
https://hg.tryton.org/modules/stock_supply_forecast/rev/ccbdb5d0e6fe
New changeset 09cc5bdc278e by Cédric Krier in branch 'default':
Do not compute moves in the past and always return a list
https://hg.tryton.org/tryton-env/rev/09cc5bdc278e
New changeset 8ad64979acd5 by Cédric Krier in branch 'default':
Do not compute moves in the past and always return a list
https://hg.tryton.org/modules/stock_forecast/rev/8ad64979acd5

New changeset 4c3d1648f34e by Cédric Krier in branch 'default':
Test move creation before, during and after the period
https://hg.tryton.org/modules/stock_forecast/rev/4c3d1648f34e
review272251002 updated at https://codereview.tryton.org/272251002/#ps262311003
review272251002 updated at https://codereview.tryton.org/272251002/#ps260301002
msg52404 (view) Author: [hidden] (albertca) (Tryton committer) Date: 2019-10-11.00:24:28
Missatge de Cédric Krier <bugs@tryton.org> del dia dj., 10 d’oct. 2019
a les 23:44:
>
>
> Cédric Krier <cedric.krier@b2ck.com> added the comment:
>
> Do you plan to finish the patch?

I plan to do it but don't have a date. Feel free to pick the patch if
you want to.
msg52394 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-10.23:44:52
Do you plan to finish the patch?
msg52275 (view) Author: [hidden] (albertca) (Tryton committer) Date: 2019-10-03.17:39:53
For me the right behaviour is the one I propose because we already substract the quantity executed. See:

http://hg.tryton.org/modules/stock_forecast/file/tip/forecast.py#l441
msg52270 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-03.14:18:49
OK so for me, the correct behavior is to always spread the same quantity no matter the current date. So for your example, it should keep spreading 1 unit per day in all cases.
AN optimization is possible by not creating move in the past.
msg52269 (view) Author: [hidden] (albertca) (Tryton committer) Date: 2019-10-03.13:40:43
Missatge de Cédric Krier <bugs@tryton.org> del dia dj., 3 d’oct. 2019 a les
9:31:

>
> Cédric Krier <cedric.krier@b2ck.com> added the comment:
>
> I do not see the problem. The forecast is smoothly distributed on a date
> range.
>

Yes but the date range used for computing the distribution is:

delta = from_date - to_date

*but* later the date used for creating the moves starts at:

self.forecast.from_date

So, say the user created a forecast between Sept 1st - 30th of 30 units
(with minimum of 1 unit). Suppose no products where actually consumed yet
and today is September 21th.

The current computation would spread 30 units among 10 days (that is 3
units a day). But it would start spreading starting on September 1st
instead of Sept 21th.
msg52265 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-03.09:31:17
I do not see the problem. The forecast is smoothly distributed on a date range.
review272251002 updated at https://codereview.tryton.org/272251002/#ps268061002
msg52263 (view) Author: [hidden] (albertca) (Tryton committer) Date: 2019-10-03.00:55:31
While working on issue8702 I realized that stock_forecast's create_moves() creates moves in the past.
History
Date User Action Args
2019-11-15 18:39:58roundup-botsetmessages: + msg53229
keyword: - backport
2019-11-02 17:33:15roundup-botsetmessages: + msg53005
2019-11-02 17:33:11roundup-botsetmessages: + msg53004
2019-10-30 13:25:37roundup-botsetmessages: + msg52795
2019-10-30 13:25:24roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg52794
2019-10-30 13:23:24cedsetkeyword: + backport
2019-10-25 16:22:17reviewbotsetmessages: + msg52718
2019-10-25 16:10:53cedsetassignedto: albertca -> ced
2019-10-11 00:43:17reviewbotsetmessages: + msg52405
2019-10-11 00:24:28albertcasetmessages: + msg52404

Showing 10 items. Show all history (warning: this could be VERY long)