From 6ecb064264cd554d95c56dee1e9ed6af271915aa Mon Sep 17 00:00:00 2001 From: ljain112 Date: Thu, 18 Jul 2024 17:40:19 +0530 Subject: [PATCH] fix: set pos data if not return doc (cherry picked from commit 65d672da651bacfe847e26c4d19e4c7a4b11a634) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 76b4f595a00..4c899b901ca 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -428,11 +428,12 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e frappe.msgprint(__("Please specify Company to proceed")); } else { var me = this; + const for_validate = me.frm.doc.is_return ? true : false; return this.frm.call({ doc: me.frm.doc, method: "set_missing_values", args: { - for_validate: true, + for_validate: for_validate, }, callback: function (r) { if (!r.exc) {