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
Jérome Perrin
slapos.core
Commits
bec6418b
Commit
bec6418b
authored
Sep 06, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alarm desactivate personal computer: skip filter computer list by creation_date
parent
c9598767
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkAndUpdatePersonalComputerAllocationScope.py
...ng/Alarm_checkAndUpdatePersonalComputerAllocationScope.py
+4
-3
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+2
-0
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkAndUpdatePersonalComputerAllocationScope.py
View file @
bec6418b
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5Type.DateUtils
import
addToDate
#
from Products.ERP5Type.DateUtils import addToDate
from
Products.ZSQLCatalog.SQLCatalog
import
Query
#
from Products.ZSQLCatalog.SQLCatalog import Query
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
...
@@ -10,7 +10,8 @@ if category_personal is not None:
...
@@ -10,7 +10,8 @@ if category_personal is not None:
portal
.
portal_catalog
.
searchAndActivate
(
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Computer'
,
portal_type
=
'Computer'
,
validation_state
=
'validated'
,
validation_state
=
'validated'
,
creation_date
=
Query
(
range
=
"max"
,
creation_date
=
addToDate
(
DateTime
(),
{
'day'
:
-
30
})),
# XXX - creation_date is not indexed for computer
# creation_date=Query(range="max", creation_date=addToDate(DateTime(), {'day': -30})),
default_allocation_scope_uid
=
category_personal
.
getUid
(),
default_allocation_scope_uid
=
category_personal
.
getUid
(),
method_id
=
'Computer_checkAndUpdatePersonalAllocationScope'
,
method_id
=
'Computer_checkAndUpdatePersonalAllocationScope'
,
activate_kw
=
{
'tag'
:
tag
})
activate_kw
=
{
'tag'
:
tag
})
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
bec6418b
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
transaction
import
transaction
from
Products.SlapOS.tests.testSlapOSMixin
import
\
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
testSlapOSMixin
from
unittest
import
skip
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
...
@@ -989,6 +990,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by C
...
@@ -989,6 +990,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by C
self
.
assertEqual
(
'Visited by Computer_checkAndUpdatePersonalAllocationScope'
,
self
.
assertEqual
(
'Visited by Computer_checkAndUpdatePersonalAllocationScope'
,
self
.
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
self
.
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
@
skip
(
'computer creation date is not indexed'
)
def
test_alarm_allowed_allocation_scope_OpenPersonal_recent_computer
(
self
):
def
test_alarm_allowed_allocation_scope_OpenPersonal_recent_computer
(
self
):
self
.
_makeComputer
()
self
.
_makeComputer
()
def
getCreationDate
(
self
):
def
getCreationDate
(
self
):
...
...
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