Browse Source

Merge pull request #2840 from pratu16x7/search-fix

[fix] child tables inclusion condition
version-14
Nabin Hait 8 years ago
committed by GitHub
parent
commit
5f7a84cd5f
4 changed files with 1366 additions and 1361 deletions
  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
File diff suppressed because it is too large
View File


+ 2
- 2
frappe/public/css/desk.css View File

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


+ 2
- 2
frappe/public/less/desk.less View File

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

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

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


+ 7
- 2
frappe/utils/global_search.py View File

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

import frappe
from frappe.utils import cint

def setup_global_search_table():
'''Creates __global_seach table'''
@@ -30,6 +31,11 @@ def update_global_search(doc):
`frappe.flags.update_global_search` from given doc
: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:
frappe.flags.update_global_search = []

@@ -41,8 +47,7 @@ def update_global_search(doc):
# Get children
for d in doc.get(field.fieldname):
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):
content.append(field.label + ": " + unicode(d.get(field.fieldname)))
else:


Loading…
Cancel
Save