result = (value, dict_names[value])
if field_type == 'binary':
-- if context.get('bin_size', False):
++ if context.get('bin_size'):
# client requests only the size of binary fields
result = get_nice_size(value)
- else:
+ elif not context.get('bin_raw'):
result = sanitize_binary_value(value)
if field_type in ("integer","integer_big") and value > xmlrpclib.MAXINT:
return table_obj.browse(cr, uid, ids, list_class=browse_record_list, context=context, fields_process=_fields_process)
def create(self, cr, uid, ids, data, context=None):
+ if context is None:
+ context = {}
if self.internal_header:
-- context.update({'internal_header':self.internal_header})
- #we ask osv.fields.sanitize_binary_value() not to encode the binary value"
- context.update({'bin_raw':True})
++ context.update(internal_header=self.internal_header)
++ # skip osv.fields.sanitize_binary_value() because we want the raw bytes in all cases
++ context.update(bin_raw=True)
pool = pooler.get_pool(cr.dbname)
ir_obj = pool.get('ir.actions.report.xml')
report_xml_ids = ir_obj.search(cr, uid,