Merge pull request #32773 from AnandBaburajan/asset_bill_date_new

fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date
This commit is contained in:
Deepesh Garg 2022-11-03 09:51:44 +05:30 committed by GitHub
commit f5478c871c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -432,7 +432,11 @@ frappe.ui.form.on('Asset', {
set_values_from_purchase_doc: function(frm, doctype, purchase_doc) {
frm.set_value('company', purchase_doc.company);
frm.set_value('purchase_date', purchase_doc.posting_date);
if (purchase_doc.bill_date) {
frm.set_value('purchase_date', purchase_doc.bill_date);
} else {
frm.set_value('purchase_date', purchase_doc.posting_date);
}
const item = purchase_doc.items.find(item => item.item_code === frm.doc.item_code);
if (!item) {
doctype_field = frappe.scrub(doctype)