Переглянути джерело

Merge pull request #2840 from pratu16x7/search-fix

[fix] child tables inclusion condition
version-14
Nabin Hait 8 роки тому
committed by GitHub
джерело
коміт
5f7a84cd5f
4 змінених файлів з 1366 додано та 1361 видалено
  1. +1355
    -1355
      frappe/core/doctype/communication/communication.json
  2. +2
    -2
      frappe/public/css/desk.css
  3. +2
    -2
      frappe/public/less/desk.less
  4. +7
    -2
      frappe/utils/global_search.py

+ 1355
- 1355
frappe/core/doctype/communication/communication.json
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 2
- 2
frappe/public/css/desk.css Переглянути файл

@@ -724,11 +724,11 @@ fieldset[disabled] .form-control {
text-align: center; text-align: center;
} }
.search-dialog .results-area .search-intro-placeholder span i { .search-dialog .results-area .search-intro-placeholder span i {
font-size: 120px;
font-size: 64px;
display: block; display: block;
} }
.search-dialog .results-area .search-intro-placeholder span p { .search-dialog .results-area .search-intro-placeholder span p {
font-size: 20px;
font-size: 15px;
display: block; display: block;
} }
.search-dialog .results-area .single-link a { .search-dialog .results-area .single-link a {


+ 2
- 2
frappe/public/less/desk.less Переглянути файл

@@ -613,12 +613,12 @@ textarea.form-control {
text-align: center; text-align: center;


i { i {
font-size: 120px;
font-size: 64px;
display: block; display: block;
} }


p { p {
font-size: 20px;
font-size: 15px;
display: block; display: block;
} }
} }


+ 7
- 2
frappe/utils/global_search.py Переглянути файл

@@ -4,6 +4,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals


import frappe import frappe
from frappe.utils import cint


def setup_global_search_table(): def setup_global_search_table():
'''Creates __global_seach table''' '''Creates __global_seach table'''
@@ -30,6 +31,11 @@ def update_global_search(doc):
`frappe.flags.update_global_search` from given doc `frappe.flags.update_global_search` from given doc
:param doc: Document to be added to global search''' :param doc: Document to be added to global search'''


if cint(doc.meta.istable) == 1 and frappe.db.exists("DocType", doc.parenttype):
d = frappe.get_doc(doc.parenttype, doc.parent)
update_global_search(d)
return

if frappe.flags.update_global_search==None: if frappe.flags.update_global_search==None:
frappe.flags.update_global_search = [] frappe.flags.update_global_search = []


@@ -41,8 +47,7 @@ def update_global_search(doc):
# Get children # Get children
for d in doc.get(field.fieldname): for d in doc.get(field.fieldname):
if d.parent == doc.name: if d.parent == doc.name:

for field in d.meta.fields:
for field in d.meta.get_global_search_fields():
if d.get(field.fieldname): if d.get(field.fieldname):
content.append(field.label + ": " + unicode(d.get(field.fieldname))) content.append(field.label + ": " + unicode(d.get(field.fieldname)))
else: else:


Завантаження…
Відмінити
Зберегти