Skip to content

Commit fd48fb4

Browse files
marcramsermergify[bot]
authored andcommitted
fix(Purchase Receipt): copy project from first row when adding items
Adds `items_add` method to copy expense_account, cost_center and project from first row to newly added items, matching Purchase Invoice behavior. (cherry picked from commit 2142367)
1 parent a57a9d7 commit fd48fb4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

erpnext/stock/doctype/purchase_receipt/purchase_receipt.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,15 @@ erpnext.stock.PurchaseReceiptController = class PurchaseReceiptController extend
365365
apply_putaway_rule() {
366366
if (this.frm.doc.apply_putaway_rule) erpnext.apply_putaway_rule(this.frm);
367367
}
368+
369+
items_add(doc, cdt, cdn) {
370+
const row = frappe.get_doc(cdt, cdn);
371+
this.frm.script_manager.copy_from_first_row("items", row, [
372+
"expense_account",
373+
"cost_center",
374+
"project",
375+
]);
376+
}
368377
};
369378

370379
// for backward compatibility: combine new and previous states

0 commit comments

Comments
 (0)