fix(UX): dont apply price list when changing batch on mapped docs (#31503)
fix(UX): dont apply price list batch change on mapped docs
This commit is contained in:
parent
7b093e5803
commit
7e40c86c56
@ -1107,9 +1107,25 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_a_mapped_document(item) {
|
||||||
|
const mapped_item_field_map = {
|
||||||
|
"Delivery Note Item": ["si_detail", "so_detail", "dn_detail"],
|
||||||
|
"Sales Invoice Item": ["dn_detail", "so_detail", "sales_invoice_item"],
|
||||||
|
"Purchase Receipt Item": ["purchase_order_item", "purchase_invoice_item", "purchase_receipt_item"],
|
||||||
|
"Purchase Invoice Item": ["purchase_order_item", "pr_detail", "po_detail"],
|
||||||
|
};
|
||||||
|
const mappped_fields = mapped_item_field_map[item.doctype] || [];
|
||||||
|
|
||||||
|
return mappped_fields
|
||||||
|
.map((field) => item[field])
|
||||||
|
.filter(Boolean).length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
batch_no(doc, cdt, cdn) {
|
batch_no(doc, cdt, cdn) {
|
||||||
let item = frappe.get_doc(cdt, cdn);
|
let item = frappe.get_doc(cdt, cdn);
|
||||||
this.apply_price_list(item, true);
|
if (!this.is_a_mapped_document(item)) {
|
||||||
|
this.apply_price_list(item, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle_conversion_factor(item) {
|
toggle_conversion_factor(item) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user