From 99b583f688966cc89d069f8c5b7c4cf88108abb5 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 9 Jun 2021 00:06:35 +0530 Subject: [PATCH] fix: on click of duplicate button system copy the difference account from first row --- erpnext/stock/doctype/stock_entry/stock_entry.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 93a6fc0e0a..1a25994b24 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -986,7 +986,10 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ items_add: function(doc, cdt, cdn) { var row = frappe.get_doc(cdt, cdn); - this.frm.script_manager.copy_from_first_row("items", row, ["expense_account", "cost_center"]); + + if (!(row.expense_account && row.cost_center)) { + this.frm.script_manager.copy_from_first_row("items", row, ["expense_account", "cost_center"]); + } if(!row.s_warehouse) row.s_warehouse = this.frm.doc.from_warehouse; if(!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;