Add patch issue7342 which improves performance of stock quantity queries.
This commit is contained in:
parent
742f795010
commit
03b784324a
|
@ -0,0 +1,17 @@
|
|||
--- a/trytond/trytond/modules/stock/move.py
|
||||
+++ b/trytond/trytond/modules/stock/move.py
|
||||
@@ -1270,8 +1270,11 @@
|
||||
if periods:
|
||||
period, = periods
|
||||
state_date_clause = lambda: (
|
||||
- Coalesce(move.effective_date, move.planned_date,
|
||||
- datetime.date.max) > period.date)
|
||||
+ (move.effective_date > period.date)
|
||||
+ | ((move.effective_date == Null)
|
||||
+ & (move.planned_date > period.date))
|
||||
+ | ((move.effective_date == Null)
|
||||
+ & (move.planned_date == Null)))
|
||||
state_date_clause_in &= state_date_clause()
|
||||
state_date_clause_out &= state_date_clause()
|
||||
|
||||
|
Loading…
Reference in New Issue