forked from Techsystech/web
Merge pull request #437 from laslabs/bugfix/9.0/#431-web_widget_float_formula-focused
[IMP] web_widget_float_formula: Focused bug fix9.0
commit
42f706ec5f
|
@ -15,7 +15,7 @@ odoo.define('web_widget_float_formula', function(require) {
|
||||||
for (var f in this.fields) {
|
for (var f in this.fields) {
|
||||||
if (!this.fields.hasOwnProperty(f)) { continue; }
|
if (!this.fields.hasOwnProperty(f)) { continue; }
|
||||||
f = this.fields[f];
|
f = this.fields[f];
|
||||||
if (f.hasOwnProperty('_formula_text')) {
|
if (f.hasOwnProperty('_formula_text') && f.$el.find('input').length > 0) {
|
||||||
f._compute_result();
|
f._compute_result();
|
||||||
f._clean_formula_text();
|
f._clean_formula_text();
|
||||||
}
|
}
|
||||||
|
@ -52,12 +52,7 @@ odoo.define('web_widget_float_formula', function(require) {
|
||||||
},
|
},
|
||||||
|
|
||||||
_process_formula: function(formula) {
|
_process_formula: function(formula) {
|
||||||
try{
|
var clean_formula = formula.toString().replace(/^\s+|\s+$/g, '');
|
||||||
formula = formula.toString();
|
|
||||||
} catch (ex) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
var clean_formula = formula.replace(/^\s+|\s+$/g, '');
|
|
||||||
if (clean_formula[0] == '=') {
|
if (clean_formula[0] == '=') {
|
||||||
clean_formula = clean_formula.substring(1);
|
clean_formula = clean_formula.substring(1);
|
||||||
var myreg = new RegExp('[0-9]|\\s|\\.|,|\\(|\\)|\\+|\\-|\\*|\\/', 'g');
|
var myreg = new RegExp('[0-9]|\\s|\\.|,|\\(|\\)|\\+|\\-|\\*|\\/', 'g');
|
||||||
|
|
Loading…
Reference in New Issue