Commit bec6418b authored by Alain Takoudjou's avatar Alain Takoudjou

Alarm desactivate personal computer: skip filter computer list by creation_date

parent c9598767
from DateTime import DateTime
from Products.ERP5Type.DateUtils import addToDate
from Products.ZSQLCatalog.SQLCatalog import Query
# from Products.ERP5Type.DateUtils import addToDate
# from Products.ZSQLCatalog.SQLCatalog import Query
portal = context.getPortalObject()
......@@ -10,7 +10,8 @@ if category_personal is not None:
portal.portal_catalog.searchAndActivate(
portal_type='Computer',
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(),
method_id='Computer_checkAndUpdatePersonalAllocationScope',
activate_kw={'tag': tag})
......
......@@ -2,6 +2,7 @@
import transaction
from Products.SlapOS.tests.testSlapOSMixin import \
testSlapOSMixin
from unittest import skip
from DateTime import DateTime
from Products.ERP5Type.tests.utils import createZODBPythonScript
......@@ -989,6 +990,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by C
self.assertEqual('Visited by Computer_checkAndUpdatePersonalAllocationScope',
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):
self._makeComputer()
def getCreationDate(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment