mirror of
https://github.com/frappe/books.git
synced 2024-12-25 20:11:15 +00:00
fix: validate field only if value is set
This commit is contained in:
parent
53b0eea4f2
commit
ce5ecd1c18
@ -244,7 +244,7 @@ module.exports = class BaseDocument extends Observable {
|
|||||||
if (field.fieldtype == 'Select') {
|
if (field.fieldtype == 'Select') {
|
||||||
this.meta.validateSelect(field, value);
|
this.meta.validateSelect(field, value);
|
||||||
}
|
}
|
||||||
if (field.validate) {
|
if (field.validate && value != null) {
|
||||||
let validator = null;
|
let validator = null;
|
||||||
if (typeof field.validate === 'object') {
|
if (typeof field.validate === 'object') {
|
||||||
validator = this.getValidateFunction(field.validate);
|
validator = this.getValidateFunction(field.validate);
|
||||||
|
Loading…
Reference in New Issue
Block a user