fix: explicit check of return value of validate

This commit is contained in:
Shivam Mishra 2020-04-28 13:55:47 +05:30
parent ad66cfcb8b
commit 14d02cbbfb

View file

@ -102,7 +102,9 @@ export default class WebForm extends frappe.ui.FieldGroup {
} }
save() { save() {
this.validate && this.validate(); if (this.validate && !this.validate()) {
frappe.throw(__("Couldn't save, please check the data you have entered"), __("Validation"))
}
// validation hack: get_values will check for missing data // validation hack: get_values will check for missing data
let doc_values = super.get_values(this.allow_incomplete); let doc_values = super.get_values(this.allow_incomplete);