diff -r 1a23abef97c8 trytond/trytond/modules/stock/move.py --- a/trytond/trytond/modules/stock/move.py Fri Jul 14 13:09:41 2017 +0200 +++ b/trytond/trytond/modules/stock/move.py Fri Jul 14 13:16:27 2017 +0200 @@ -620,9 +620,6 @@ @Workflow.transition('assigned') def assign(cls, moves): cls.check_origin(moves) - for move in moves: - move.set_effective_date() - move.save() @classmethod @ModelView.button @@ -868,7 +865,8 @@ stock_date_start: if set return the delta of the stock between the two dates, (ignored if stock_date_end is missing). stock_assign: if set compute also the assigned outgoing moves as - done. + done at the stock_date_end except for delta which is at the + planned date. forecast: if set compute the forecast quantity. stock_destinations: A list of location ids. If set, restrict the computation to moves from and to those locations. @@ -934,6 +932,9 @@ & (move.planned_date <= context['stock_date_end']) ) | (move.effective_date <= context['stock_date_end']) + | (move.state == ( + 'assigned' if not context.get('stock_date_start') + else '')) ) ) state_date_clause_in = state_date_clause(False) @@ -952,6 +953,10 @@ & (move.planned_date <= today) ) | (move.effective_date <= today) + | (move.state == ( + 'assigned' + if not context.get('stock_date_start') + else '')) ) ) | (move.state.in_(['done', 'assigned', 'draft']) @@ -967,6 +972,10 @@ (move.effective_date <= context['stock_date_end']) & (move.effective_date >= today) ) + | (move.state == ( + 'assigned' + if not context.get('stock_date_start') + else '')) ) ) )