fix: get tags for rfq (#19564)

* fix: get tags for rfq

* chore: remove console log
This commit is contained in:
Himanshu 2019-11-13 19:21:53 +05:30 committed by Nabin Hait
parent af7fe1937e
commit 1ad2d4a962
2 changed files with 6 additions and 10 deletions

View File

@ -134,7 +134,7 @@ frappe.ui.form.on("Request for Quotation",{
if (args.search_type === "Tag" && args.tag) {
return frappe.call({
type: "GET",
method: "frappe.desk.tags.get_tagged_docs",
method: "frappe.desk.doctype.tag.tag.get_tagged_docs",
args: {
"doctype": "Supplier",
"tag": args.tag

View File

@ -344,13 +344,9 @@ def get_item_from_material_requests_based_on_supplier(source_name, target_doc =
@frappe.whitelist()
def get_supplier_tag():
data = frappe.db.sql("select _user_tags from `tabSupplier`")
tags = []
for tag in data:
tags += filter(bool, tag[0].split(","))
tags = list(set(tags))
return tags
if not frappe.cache().hget("Supplier", "Tags"):
filters = {"document_type": "Supplier"}
tags = list(set([tag.tag for tag in frappe.get_all("Tag Link", filters=filters, fields=["tag"]) if tag]))
frappe.cache().hset("Supplier", "Tags", tags)
return frappe.cache().hget("Supplier", "Tags")