From 65d672da651bacfe847e26c4d19e4c7a4b11a634 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 --- 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 0b8b1304f20..d5fc02d3229 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -505,11 +505,12 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends ( 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) {