[merge]
[odoo/odoo.git] / addons / web / static / src / js / view_form.js
index dffb4c9..e517e68 100644 (file)
@@ -1683,16 +1683,11 @@ openerp.web.form.FieldFloat = openerp.web.form.FieldChar.extend({
         this._super(view, node);
         this.value = 0;
         if (this.node.attrs.digits) {
-            this.parse_digits(this.node.attrs.digits);
+            this.digits = py.eval(this.node.attrs.digits).toJSON();
         } else {
             this.digits = this.field.digits;
         }
     },
-    parse_digits: function (digits_attr) {
-        // could use a Python parser instead.
-        var match = /^\s*[\(\[](\d+),\s*(\d+)/.exec(digits_attr);
-        return [parseInt(match[1], 10), parseInt(match[2], 10)];
-    },
     set_value: function(value) {
         if (value === false || value === undefined) {
             // As in GTK client, floats default to 0
@@ -3032,6 +3027,10 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
             this.new_object();
         }
     },
+    stop: function () {
+        this.$element.dialog('close');
+        this._super();
+    },
     setup_search_view: function(search_defaults) {
         var self = this;
         if (this.searchview) {