2
0
mirror of https://github.com/frappe/books.git synced 2024-12-25 12:10:06 +00:00

fix: validate field only if value is set

This commit is contained in:
Faris Ansari 2020-01-01 13:39:31 +05:30
parent 53b0eea4f2
commit ce5ecd1c18

View File

@ -244,7 +244,7 @@ module.exports = class BaseDocument extends Observable {
if (field.fieldtype == 'Select') {
this.meta.validateSelect(field, value);
}
if (field.validate) {
if (field.validate && value != null) {
let validator = null;
if (typeof field.validate === 'object') {
validator = this.getValidateFunction(field.validate);