Binary field tree view causes error on empty field

Bug #1191037 reported by Ludo (Neobis)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Committed
Low
OpenERP Publisher's Warranty Team

Bug Description

This bug occurs when you add a binary field on a tree view. When you do, and the field is empty, it still provides you with a download-button, as well as file information regarding the non-existing file (it states that the file is 0.00 bytes).

When pressing the "download" button when the field itself is empty, the server presents you with an error, namely:
--------------------
Internal Server Error

{"message": "OpenERP WebClient Error", "code": 300, "data": {"debug": "Client Traceback (most recent call last):\n File \"/$mylocation/web/http.py\", line 284, in dispatch\n r = method(self, **self.params)\n File \"/$mylocation/web/controllers/main.py\", line 1282, in saveas\n filecontent = base64.b64decode(res.get(field, ''))\n File \"/usr/lib/python2.6/base64.py\", line 73, in b64decode\n return binascii.a2b_base64(s)\nTypeError: a2b_base64() argument 1 must be string or read-only character buffer, not bool\n", "type": "client_exception"}}
--------------------

The form view does this correctly, by not displaying a button nor file information.

Using OpenERP v7 from the /7 branch.
Server revno: 4910
Addons revno: 8950
Web revno: 3867

Related branches

Changed in openobject-server:
status: New → Confirmed
Changed in openobject-server:
importance: Undecided → Low
affects: openobject-server → openerp-web
Changed in openerp-web:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.