Support field name on image tag

issue7058
review35851002
This commit is contained in:
Cédric Krier
2018-01-23 22:15:21 +01:00
parent 24ef842a26
commit 53300b651f
2 changed files with 13 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Support field name on image tag
* Use input number and toLocaleString for numeric fields
* Show related record names for all windows
* Allow to edit Many2One from tree view
+12 -1
View File
@@ -833,7 +833,18 @@ function eval_pyson(value){
this.img = jQuery('<img/>', {
'class': 'center-block'
}).appendTo(this.el);
Sao.common.ICONFACTORY.register_icon(attributes.name)
},
set_state: function(record) {
Sao.View.Form.Image_._super.set_state.call(this, record);
if (!record) {
return;
}
var name = this.attributes.name;
if (name in record.model.fields) {
var field = record.model.fields[name];
name = field.get(record);
}
Sao.common.ICONFACTORY.register_icon(name)
.done(function(url) {
this.img.attr('src', url);
}.bind(this));