[FIX] ir_attachment: fix regression when counting attachments (OPW 576295)
[FIX] ir_attachment: fix regression when counting attachments (OPW 576295)

Cherry-pick forward-port of rev-id odo@openerp.com-20120816154020-5s6wbwfb5l2xsnyv
from 6.1. Fixes regression introduced by r.4069.

akretion/openerp-server,akretion/openerp-server,akretion/openerp-server