diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js index 356f11ba97..4c22b0dc89 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js @@ -99,4 +99,17 @@ frappe.ui.form.on('Pricing Rule', 'price_or_discount', function(frm){ if(frm.doc.price_or_discount == 'Price') { frm.set_value('for_price_list', "") } +}) + +frappe.ui.form.on('Pricing Rule', { + setup: function(frm) { + frm.fields_dict["for_price_list"].get_query = function(doc){ + return { + filters: { + 'selling': doc.selling, + 'buying': doc.buying + } + } + } + } }) \ No newline at end of file