fix: only check for payment_account on bank entry (#21445) (#21518)

* fix: only check for payment_account on bank entry

Since all the fields (company, start and end date are mandatory before form submission, there is no need to check for them again after submission.

* fix: cur_frm to frm

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit 95b186268c)

Co-authored-by: Michelle Alva <50285544+michellealva@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2020-04-30 19:53:59 +05:30
committed by GitHub
parent a8b87ccce0
commit 426f0bc168

View File

@@ -249,7 +249,7 @@ const submit_salary_slip = function (frm) {
let make_bank_entry = function (frm) {
var doc = frm.doc;
if (doc.company && doc.start_date && doc.end_date && doc.payment_account) {
if (doc.payment_account) {
return frappe.call({
doc: cur_frm.doc,
method: "make_payment_entry",
@@ -262,7 +262,8 @@ let make_bank_entry = function (frm) {
freeze_message: __("Creating Payment Entries......")
});
} else {
frappe.msgprint(__("Company, Payment Account, From Date and To Date is mandatory"));
frappe.msgprint(__("Payment Account is mandatory"));
frm.scroll_to_field('payment_account');
}
};