Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eric Zheng
slapos.core
Commits
1efa0582
Commit
1efa0582
authored
Jul 20, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor code to simplify the search
parent
d563adec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+4
-11
No files found.
master/product/Vifib/Tool/SlapTool.py
View file @
1efa0582
...
@@ -35,7 +35,6 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed
...
@@ -35,7 +35,6 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
ComplexQuery
from
lxml
import
etree
from
lxml
import
etree
try
:
try
:
from
slapos.slap.slap
import
Computer
from
slapos.slap.slap
import
Computer
...
@@ -775,25 +774,19 @@ class SlapTool(BaseTool):
...
@@ -775,25 +774,19 @@ class SlapTool(BaseTool):
state_list
.
extend
(
portal
.
getPortalCurrentInventoryStateList
())
state_list
.
extend
(
portal
.
getPortalCurrentInventoryStateList
())
state_list
.
extend
(
portal
.
getPortalReservedInventoryStateList
())
state_list
.
extend
(
portal
.
getPortalReservedInventoryStateList
())
state_list
.
extend
(
portal
.
getPortalTransitInventoryStateList
())
state_list
.
extend
(
portal
.
getPortalTransitInventoryStateList
())
aggregate_dict
=
{
"aggregate_relative_url"
:
\
computer_partition_document
.
getRelativeUrl
()}
if
slave_reference
is
not
None
:
if
slave_reference
is
not
None
:
slave_instance
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Slave Instance"
,
aggregate_dict
[
"aggregate_reference"
]
=
slave_reference
reference
=
slave_reference
)
query
=
ComplexQuery
(
Query
(
aggregate_relative_url
=
computer_partition_document
.
getRelativeUrl
()),
Query
(
aggregate_relative_url
=
slave_instance
.
getRelativeUrl
()),
operator
=
"AND"
,
)
else
:
query
=
Query
(
aggregate_relative_url
=
computer_partition_document
.
getRelativeUrl
())
# Use getTrackingList
# Use getTrackingList
catalog_result
=
portal
.
portal_catalog
(
catalog_result
=
portal
.
portal_catalog
(
portal_type
=
'Sale Packing List Line'
,
portal_type
=
'Sale Packing List Line'
,
simulation_state
=
state_list
,
simulation_state
=
state_list
,
aggregate_relative_url
=
query
,
default_resource_uid
=
service_uid_list
,
default_resource_uid
=
service_uid_list
,
sort_on
=
((
'movement.start_date'
,
'DESC'
),),
sort_on
=
((
'movement.start_date'
,
'DESC'
),),
limit
=
1
,
limit
=
1
,
**
aggregate_dict
)
)
if
len
(
catalog_result
):
if
len
(
catalog_result
):
return
catalog_result
[
0
].
getObject
()
return
catalog_result
[
0
].
getObject
()
...
...
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