odoo/odoo — pull request #2673 by rco-odoo (2014-09-24 13:46:34+00:00)
Title: [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.

Fixes #2386.