mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix widget bug
This commit is contained in:
@@ -44,7 +44,13 @@ odoo.define('web.inputmask_widget', function (require) {
|
||||
is_valid: function () {
|
||||
var musk = this.attributes['data-inputmask-regex'] ? this.attributes['data-inputmask-regex'] : this.attributes['data-inputmask'] ;
|
||||
var reg = new RegExp (musk,"g");
|
||||
//当状态变化成只读时,则默认全部通过
|
||||
try {
|
||||
var value = this.$input.val();
|
||||
} catch(err) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!this.get('required') && this.is_false()) {
|
||||
return true;
|
||||
} else if (reg.test(value)) {
|
||||
|
||||
Reference in New Issue
Block a user