fix: get tags for rfq (#19564)
* fix: get tags for rfq * chore: remove console log
This commit is contained in:
parent
af7fe1937e
commit
1ad2d4a962
@ -134,7 +134,7 @@ frappe.ui.form.on("Request for Quotation",{
|
|||||||
if (args.search_type === "Tag" && args.tag) {
|
if (args.search_type === "Tag" && args.tag) {
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
method: "frappe.desk.tags.get_tagged_docs",
|
method: "frappe.desk.doctype.tag.tag.get_tagged_docs",
|
||||||
args: {
|
args: {
|
||||||
"doctype": "Supplier",
|
"doctype": "Supplier",
|
||||||
"tag": args.tag
|
"tag": args.tag
|
||||||
|
@ -344,13 +344,9 @@ def get_item_from_material_requests_based_on_supplier(source_name, target_doc =
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_supplier_tag():
|
def get_supplier_tag():
|
||||||
data = frappe.db.sql("select _user_tags from `tabSupplier`")
|
if not frappe.cache().hget("Supplier", "Tags"):
|
||||||
|
filters = {"document_type": "Supplier"}
|
||||||
tags = []
|
tags = list(set([tag.tag for tag in frappe.get_all("Tag Link", filters=filters, fields=["tag"]) if tag]))
|
||||||
for tag in data:
|
frappe.cache().hset("Supplier", "Tags", tags)
|
||||||
tags += filter(bool, tag[0].split(","))
|
|
||||||
|
|
||||||
tags = list(set(tags))
|
|
||||||
|
|
||||||
return tags
|
|
||||||
|
|
||||||
|
return frappe.cache().hget("Supplier", "Tags")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user