Update testIdToolUpgrade due to recent change in IdTool compatibility code

testIdToolUpgrade failed since commit a463bc45b8759799bf252f241c11858dae1a0227
fix TypeError in getModificationDate().

that can happen if there is a workflow entry whose value is None.
erp5_mysql_innodb_catalog: Count using a subquery so that "distinct" have same semantics as search_results