[FIX] web: many2many_binary widget upload
authorDenis Ledoux <dle@odoo.com>
Thu, 6 Nov 2014 15:26:32 +0000 (16:26 +0100)
committerDenis Ledoux <dle@odoo.com>
Thu, 6 Nov 2014 15:26:32 +0000 (16:26 +0100)
once widget extended with ReinitializeFieldMixin, the event binding with the binary file input and the on_file_change method can be done in initialize_content instead of start

This fix is related to d36c8b5c9bf7ab9215bc63db6ee49bec5e5b225b

addons/web/static/src/js/view_form.js

index 077b05c..819920f 100644 (file)
@@ -5235,9 +5235,7 @@ instance.web.form.FieldMany2ManyBinaryMultiFiles = instance.web.form.AbstractFie
         this.fileupload_id = _.uniqueId('oe_fileupload_temp');
         $(window).on(this.fileupload_id, _.bind(this.on_file_loaded, this));
     },
-    start: function() {
-        this._super();
-        instance.web.form.ReinitializeFieldMixin.start.call(this);
+    initialize_content: function() {
         this.$el.on('change', 'input.oe_form_binary_file', this.on_file_change );
     },
     set_value: function(value_) {