Merge pull request #26017 from rohitwaghchaure/donot-copy-difference-account-develop

fix: on click of duplicate button system has not copied the difference account
This commit is contained in:
rohitwaghchaure 2021-06-11 12:17:36 +05:30 committed by GitHub
commit 49f3e5bbd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -978,7 +978,10 @@ erpnext.stock.StockEntry = class StockEntry extends erpnext.stock.StockControlle
items_add(doc, cdt, cdn) { items_add(doc, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn); var row = frappe.get_doc(cdt, cdn);
if (!(row.expense_account && row.cost_center)) {
this.frm.script_manager.copy_from_first_row("items", row, ["expense_account", "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.s_warehouse) row.s_warehouse = this.frm.doc.from_warehouse;
if(!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse; if(!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;