diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 3a174f466d5..ce4ab508078 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -189,7 +189,7 @@
-
+
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 1fc1297ee03..f360b1b7783 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -5390,6 +5390,17 @@ instance.web.form.FieldBinaryFile = instance.web.form.FieldBinary.extend({
this._super.apply(this, arguments);
this.$el.find('input').eq(0).val('');
this.set_filename('');
+ },
+ set_value: function(value_){
+ var changed = value_ !== this.get_value();
+ this._super.apply(this, arguments);
+ // Trigger value change if size is the same
+ if (!changed){
+ this.trigger("change:value", this, {
+ oldValue: value_,
+ newValue: value_
+ });
+ }
}
});
diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py
index b78a233cf23..2ef2cd98a69 100644
--- a/openerp/addons/base/ir/ir_attachment.py
+++ b/openerp/addons/base/ir/ir_attachment.py
@@ -133,6 +133,9 @@ class ir_attachment(osv.osv):
result[attach.id] = self._file_read(cr, uid, location, attach.store_fname, bin_size)
else:
result[attach.id] = attach.db_datas
+ if bin_size:
+ result[attach.id] = int(result[attach.id])
+
return result
def _data_set(self, cr, uid, id, name, value, arg, context=None):