Преглед на файлове

fix: explicitly set doctype in queries (#18403) (#18405)

(cherry picked from commit 2f358dea03)

Co-authored-by: Dany Robert <danyrt@wahni.com>
version-14
mergify[bot] преди 2 години
committed by GitHub
родител
ревизия
6848ee9c57
No known key found for this signature in database GPG ключ ID: 4AEE18F83AFDEB23
променени са 3 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. +2
    -1
      frappe/contacts/doctype/address/address.py
  2. +2
    -1
      frappe/contacts/doctype/contact/contact.py
  3. +1
    -0
      frappe/core/doctype/user/user.py

+ 2
- 1
frappe/contacts/doctype/address/address.py Целия файл

@@ -228,11 +228,12 @@ def get_company_address(company):
def address_query(doctype, txt, searchfield, start, page_len, filters):
from frappe.desk.reportview import get_match_cond

doctype = "Address"
link_doctype = filters.pop("link_doctype")
link_name = filters.pop("link_name")

condition = ""
meta = frappe.get_meta("Address")
meta = frappe.get_meta(doctype)
for fieldname, value in filters.items():
if meta.get_field(fieldname) or fieldname in frappe.db.DEFAULT_COLUMNS:
condition += f" and {fieldname}={frappe.db.escape(value)}"


+ 2
- 1
frappe/contacts/doctype/contact/contact.py Целия файл

@@ -210,8 +210,9 @@ def update_contact(doc, method):
def contact_query(doctype, txt, searchfield, start, page_len, filters):
from frappe.desk.reportview import get_match_cond

doctype = "Contact"
if (
not frappe.get_meta("Contact").get_field(searchfield)
not frappe.get_meta(doctype).get_field(searchfield)
and searchfield not in frappe.db.DEFAULT_COLUMNS
):
return []


+ 1
- 0
frappe/core/doctype/user/user.py Целия файл

@@ -901,6 +901,7 @@ def reset_password(user):
def user_query(doctype, txt, searchfield, start, page_len, filters):
from frappe.desk.reportview import get_filters_cond, get_match_cond

doctype = "User"
conditions = []

user_type_condition = "and user_type != 'Website User'"


Зареждане…
Отказ
Запис