Add issue6371.diff - Do not set effective_date on assign

This commit is contained in:
Raimon Esteve 2017-07-14 15:44:04 +02:00
parent f49827058d
commit 9e88d5cb1a
2 changed files with 56 additions and 0 deletions

55
issue6371.diff Normal file
View File

@ -0,0 +1,55 @@
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 ''))
)
)
)

1
series
View File

@ -54,3 +54,4 @@ issue6294.diff # [tryton] - Creating a board view with a form inside
issue5917.diff # [tryton] - Reduce the number of request for tree_state (changeset 33c1a31d27bc)
issue5877.diff # [trytond] - Improve ModelStorage.search_count by using no order and COUNT(*) (changeset a2009809c10f)
statement_of_account.diff # [account] - remove context and show all lines on general_ledger_lines
issue6371.diff # [stock] - Do not set effective_date on assign