You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
698 B
22 lines
698 B
(function() {
|
|
|
|
var instance = openerp;
|
|
|
|
instance.web.form.FieldFloat = instance.web.form.FieldFloat.extend({
|
|
render_value: function() {
|
|
var self = this;
|
|
this._super();
|
|
if (!this.get('readonly')){
|
|
this.$el.find('input').on('keypress', this.floatKeypress.bind(this));
|
|
}
|
|
},
|
|
floatKeypress: function(e){
|
|
if(e.keyCode == '46' || e.charCode == '46'){
|
|
//Cancel the keypress
|
|
e.preventDefault();
|
|
// Add the comma to the value of the input field
|
|
this.$("input").val(this.$("input").val() + ',');
|
|
}
|
|
},
|
|
});
|
|
})();
|