[IMP] models: when checking for data in a table, do not use column 'id'
authorRaphael Collet <rco@openerp.com>
Wed, 24 Sep 2014 13:41:09 +0000 (15:41 +0200)
committerRaphael Collet <rco@openerp.com>
Thu, 25 Sep 2014 08:37:28 +0000 (10:37 +0200)
commit330a3ff6ea8e9c87a9a504cb5cc667f27957c072
treee6dc53eb1f7ded32f48c455f1a10e00f6b33016d
parent1f15055de35b07e10d8082086abf3a97fd284801
[IMP] models: when checking for data in a table, do not use column 'id'

Replace the query "SELECT min(id) FROM xxx" by "SELECT 1 FROM xxx LIMIT 1".
Both requests are as efficient, and the second one does not crash if column
'id' is missing.
openerp/models.py