Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian
erp5
Commits
63f68940
Commit
63f68940
authored
Oct 24, 2014
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KR Inventory Cache will be enabled gradually to avoid regressions.
So, do not modify getInventoryList(), at least for now.
parent
c9b37715
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+6
-10
No files found.
product/ERP5/Tool/SimulationTool.py
View file @
63f68940
...
@@ -1300,16 +1300,9 @@ class SimulationTool(BaseTool):
...
@@ -1300,16 +1300,9 @@ class SimulationTool(BaseTool):
'convert_quantity_result'
:
convert_quantity_result
,
'convert_quantity_result'
:
convert_quantity_result
,
'quantity_unit_uid'
:
quantity_unit_uid
,
'quantity_unit_uid'
:
quantity_unit_uid
,
}
}
# Get cached data
# Use Custom Inventory Cache implementation if any, before falling back
if
getattr
(
self
,
"Resource_zGetInventoryCacheResult"
,
None
)
is
not
None
and
\
# on ERP5 Generic Cache implementation
optimisation__
and
(
not
kw
.
get
(
'from_date'
))
and
\
cached_result
=
[]
if
optimisation__
and
\
not
getattr
(
self
,
'SimulationTool_getInventoryCustomCache'
,
None
)(
kw
,
base_inventory_kw
,
cached_result
)
and
\
getattr
(
self
,
"Resource_zGetInventoryCacheResult"
,
None
)
is
not
None
and
\
(
not
kw
.
get
(
'from_date'
))
and
\
'transformed_resource'
not
in
kw
:
'transformed_resource'
not
in
kw
:
# Here is the different kind of date
# Here is the different kind of date
# from_date : >=
# from_date : >=
...
@@ -1330,6 +1323,7 @@ class SimulationTool(BaseTool):
...
@@ -1330,6 +1323,7 @@ class SimulationTool(BaseTool):
sql_kw
=
kw
,
sql_kw
=
kw
,
**
base_inventory_kw
)
**
base_inventory_kw
)
except
StockOptimisationError
:
except
StockOptimisationError
:
cached_result
=
[]
kw
[
'to_date'
]
=
to_date
kw
[
'to_date'
]
=
to_date
else
:
else
:
if
src__
:
if
src__
:
...
@@ -1337,6 +1331,8 @@ class SimulationTool(BaseTool):
...
@@ -1337,6 +1331,8 @@ class SimulationTool(BaseTool):
# Now must generate query for date diff
# Now must generate query for date diff
kw
[
'to_date'
]
=
to_date
kw
[
'to_date'
]
=
to_date
kw
[
'from_date'
]
=
cached_date
kw
[
'from_date'
]
=
cached_date
else
:
cached_result
=
[]
sql_kw
,
new_kw
=
self
.
_generateKeywordDict
(
**
kw
)
sql_kw
,
new_kw
=
self
.
_generateKeywordDict
(
**
kw
)
# Copy kw content as _generateSQLKeywordDictFromKeywordDict
# Copy kw content as _generateSQLKeywordDictFromKeywordDict
# remove some values from it
# remove some values from it
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment