[IMP] web_form: multifile, don't set_value with object
bzr revid: chm@openerp.com-20130228155112-z6jhpljfuvwiw1yd
This commit is contained in:
parent
6ad4482d71
commit
1331af91d4
|
@ -5046,12 +5046,9 @@ instance.web.form.FieldMany2ManyBinaryMultiFiles = instance.web.form.AbstractFie
|
|||
this.$el.on('change', 'input.oe_form_binary_file', this.on_file_change );
|
||||
},
|
||||
set_value: function(value_) {
|
||||
var self = this;
|
||||
value_ = value_ || [];
|
||||
if (value_.length >= 1 && value_[0] instanceof Array) {
|
||||
value_ = value_[0][2];
|
||||
} else if (value_.length >= 1 && value_[0] instanceof Object) {
|
||||
value_ = _.map(value_, function (value) { self.data[value.id] = value; return value.id;});
|
||||
}
|
||||
this._super(value_);
|
||||
},
|
||||
|
|
|
@ -1263,7 +1263,8 @@
|
|||
</t>
|
||||
<t t-name="FieldBinaryFileUploader.files">
|
||||
<div class="oe_attachments">
|
||||
<t t-if="!widget.get('effective_readonly')" t-foreach="widget.get('value')" t-as="id">
|
||||
<t t-if="!widget.get('effective_readonly')">
|
||||
<t t-foreach="widget.get('value')" t-as="id">
|
||||
<t t-set="file" t-value="widget.data[id]"/>
|
||||
<div class="oe_attachment">
|
||||
<span t-if="(file.upload or file.percent_loaded<100)" t-attf-title="{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}" t-attf-name="{file.name || file.filename}">
|
||||
|
@ -1278,6 +1279,7 @@
|
|||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
<t t-if="widget.get('effective_readonly')">
|
||||
<t t-foreach="widget.get('value')" t-as="id">
|
||||
<t t-set="file" t-value="widget.data[id]"/>
|
||||
|
|
Loading…
Reference in New Issue