diff -r 792626d1b562 trytond/trytond/modules/stock/move.py --- a/trytond/trytond/modules/stock/move.py Fri Jul 14 15:34:47 2017 +0200 +++ b/trytond/trytond/modules/stock/move.py Fri Jul 14 15:38:35 2017 +0200 @@ -628,9 +628,6 @@ @Workflow.transition('assigned') def assign(cls, moves): cls.check_origin(moves) - for move in moves: - move.set_effective_date() - cls.save(moves) @classmethod @ModelView.button @@ -907,7 +904,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. @@ -968,6 +966,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) @@ -986,6 +987,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']) @@ -1001,6 +1006,10 @@ (move.effective_date <= context['stock_date_end']) & (move.effective_date >= today) ) + | (move.state == ( + 'assigned' + if not context.get('stock_date_start') + else '')) ) ) )