diff --git a/product/ERP5/Document/Alarm.py b/product/ERP5/Document/Alarm.py index 4d1589aa8d91a5388461d864c70ea140c276b240..81e5b614ba2d7bac58bd160db097e9b372a7ec3e 100644 --- a/product/ERP5/Document/Alarm.py +++ b/product/ERP5/Document/Alarm.py @@ -508,7 +508,9 @@ Alarm Tool Node: %s limit = self.isActive() and 2 or 1 active_process_list = self.getPortalObject().portal_catalog( portal_type='Active Process', limit=limit, - sort_on=(('creation_date', 'DESC'), ), + sort_on=(('creation_date', 'DESC'), + # XXX Work around poor resolution of MySQL dates. + ('CONVERT(`catalog`.`id`, UNSIGNED)', 'DESC')), causality_uid=self.getUid()) if len(active_process_list) < limit: process = None diff --git a/product/ERP5/tests/testERP5Administration.py b/product/ERP5/tests/testERP5Administration.py index 4044c4f3227adfa1ad55d0736f6a684a34d8efce..df131d3c5ed25beaeb2356717f070ccfc66fdd67 100644 --- a/product/ERP5/tests/testERP5Administration.py +++ b/product/ERP5/tests/testERP5Administration.py @@ -38,7 +38,7 @@ class TestERP5Administration(InventoryAPITestCase): return "ERP5Administration" def getBusinessTemplateList(self): - """ + """ Same list as for Inventory API and add erp5_administration """ return InventoryAPITestCase.getBusinessTemplateList(self) + ('erp5_administration',) @@ -53,7 +53,7 @@ class TestERP5Administration(InventoryAPITestCase): alarm = portal.portal_alarms.check_stock def checkActiveProcess(failed): - transaction.get().commit() + transaction.commit() self.tic() self.assertEqual(alarm.getLastActiveProcess().ActiveProcess_sense(), failed) @@ -68,7 +68,7 @@ class TestERP5Administration(InventoryAPITestCase): alarm.setAlarmNotificationMode('never') mvt = self._makeMovement(quantity=1.23) - transaction.get().commit() + transaction.commit() self.tic() alarm.activeSense() checkActiveProcess(0)