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.

23 lines
574 B

  1. (function() {
  2. var instance = openerp;
  3. instance.web.form.FieldFloat = instance.web.form.FieldChar.extend({
  4. is_field_number: true,
  5. widget_class: 'oe_form_field_float',
  6. events: {
  7. "keyup": "floatKeyup",
  8. },
  9. floatKeyup: function(e){
  10. var code = e.which ? e.which : e.keyCode;
  11. if (code === 110){
  12. var input = this.$("input").val();
  13. input = input.substr(0, input.length -1);
  14. input += instance.web._t.database.parameters.decimal_point;
  15. this.set("value", input);
  16. }
  17. },
  18. });
  19. })();