Using 'bin_size' to read ir.attachment data gets the size of the size

Bug #1304984 reported by Houzéfa Abbasbhay on 2014-04-09
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Hi,

Binary fields accept a "bin_size" context key to avoid reading them but to only retrieve their size.

However, this is implemented in 2 places for ir.attachment data; therefore, one fetches the size of the size:
- ir.attachment handles the "bin_size" context key to send the size of its data (openerp/addons/base/ir/ir_attachment.py).
- function fields also handle the "bin_size" context key on binary fields (openerp/osv/orm.py).

It so happens that the "datas" field of ir.attachment is a function field, so both of the above apply when the context contains a "bin_size" key. Instead, only one of the two code paths should apply.

Thanks for looking into this.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers