[Erp5-report] r34570 daniele - /erp5/trunk/products/ERP5/Tool/IdTool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Apr 14 21:44:55 CEST 2010
Author: daniele
Date: Wed Apr 14 21:44:54 2010
New Revision: 34570
URL: http://svn.erp5.org?rev=34570&view=rev
Log:
Fix the code for the compatibility after the changement
of IdTool_zGetLastId
Modified:
erp5/trunk/products/ERP5/Tool/IdTool.py
Modified: erp5/trunk/products/ERP5/Tool/IdTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/IdTool.py?rev=34570&r1=34569&r2=34570&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/IdTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/IdTool.py [utf8] Wed Apr 14 21:44:54 2010
@@ -322,7 +322,10 @@
'be found.'
result = query(id_group=id_group)
if len(result):
- return result[0]['last_id'] - 1
+ try:
+ return result[0]['last_id']
+ except KeyError:
+ return result[0]['LAST_INSERT_ID()']
return default
#use in erp5_accounting
More information about the Erp5-report
mailing list