|
@ -2,11 +2,13 @@ |
|
|
|
|
|
|
|
|
var instance = openerp; |
|
|
var instance = openerp; |
|
|
|
|
|
|
|
|
instance.web.form.FieldFloat = instance.web.form.FieldChar.extend({ |
|
|
|
|
|
is_field_number: true, |
|
|
|
|
|
widget_class: 'oe_form_field_float', |
|
|
|
|
|
events: { |
|
|
|
|
|
"keypress": "floatKeypress", |
|
|
|
|
|
|
|
|
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){ |
|
|
floatKeypress: function(e){ |
|
|
if(e.keyCode == '46' || e.charCode == '46'){ |
|
|
if(e.keyCode == '46' || e.charCode == '46'){ |
|
|