예제 #1
0
    def test_link_search_in_foreign_language(self):
        frappe.local.lang = 'fr'
        search_widget(doctype="DocType", txt="pay", page_length=20)
        output = frappe.response["values"]

        result = [['found' for x in y if x == "Country"] for y in output]
        self.assertTrue(['found'] in result)
예제 #2
0
	def test_link_search_in_foreign_language(self):
		frappe.local.lang = 'fr'
		search_widget(doctype="DocType", txt="pay", page_length=20)
		output = frappe.response["values"]

		result = [['found' for x in y if x=="Country"] for y in output]
		self.assertTrue(['found'] in result)
예제 #3
0
    def test_link_search_in_foreign_language(self):
        try:
            frappe.local.lang = "fr"
            frappe.local.lang_full_dict = None  # discard translation cache
            search_widget(doctype="DocType", txt="pay", page_length=20)
            output = frappe.response["values"]

            result = [["found" for x in y if x == "Country"] for y in output]
            self.assertTrue(["found"] in result)
        finally:
            frappe.local.lang = "en"
예제 #4
0
def search_link(doctype,
                txt,
                query=None,
                filters=None,
                page_length=20,
                searchfield=None,
                reference_doctype=None,
                ignore_user_permissions=False):
    if doctype == "Item":
        query = "peark.controllers.queries.item_query"

    search_widget(doctype,
                  txt,
                  query,
                  searchfield=searchfield,
                  page_length=page_length,
                  filters=filters,
                  reference_doctype=reference_doctype,
                  ignore_user_permissions=ignore_user_permissions)

    frappe.response['results'] = \
        build_for_autosuggest(frappe.response["values"])

    del frappe.response["values"]
예제 #5
0
파일: api.py 프로젝트: finbyz/techievolve
def search_link(doctype, txt, query=None, filters=None, page_length=20, searchfield=None, reference_doctype=None, ignore_user_permissions=False):
	search_widget(doctype, txt, query, searchfield=searchfield, page_length=page_length, filters=filters, reference_doctype=reference_doctype, ignore_user_permissions=ignore_user_permissions)
	if frappe.response["values"]:
		frappe.response['results'] = build_for_autosuggest(frappe.response["values"])
		del frappe.response["values"]