mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-11 06:17:44 +00:00
feat: UOM query filter for opportunity items
Add UOM query filter based on item code in opportunity form.
(cherry picked from commit b33f06701c)
This commit is contained in:
@@ -307,6 +307,21 @@ erpnext.crm.Opportunity = class Opportunity extends frappe.ui.form.Controller {
|
||||
};
|
||||
});
|
||||
|
||||
this.frm.set_query("uom", "items", function (doc, cdt, cdn) {
|
||||
let row = locals[cdt][cdn];
|
||||
|
||||
if (!row.item_code) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
query: "erpnext.controllers.queries.get_item_uom_query",
|
||||
filters: {
|
||||
item_code: row.item_code,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
me.frm.set_query("contact_person", erpnext.queries["contact_query"]);
|
||||
|
||||
if (me.frm.doc.opportunity_from == "Lead") {
|
||||
|
||||
Reference in New Issue
Block a user