Merge pull request #481 from pdvyas/model-cleanup-hotfix
model-cleanup-fixes and others
This commit is contained in:
commit
ff769cb478
4 changed files with 9 additions and 5 deletions
|
|
@ -51,9 +51,9 @@ class SiteRouter(object):
|
|||
def route_for_task(self, task, args=None, kwargs=None):
|
||||
if hasattr(frappe.local, 'site'):
|
||||
if kwargs and kwargs.get("event", "").endswith("_long"):
|
||||
get_queue(frappe.local.site, LONGJOBS_PREFIX)
|
||||
return get_queue(frappe.local.site, LONGJOBS_PREFIX)
|
||||
else:
|
||||
get_queue(frappe.local.site)
|
||||
return get_queue(frappe.local.site)
|
||||
|
||||
return None
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ class BaseDocument(object):
|
|||
if self.get(key) is None:
|
||||
self.set(key, value)
|
||||
|
||||
def get_db_value(self, key):
|
||||
return frappe.db.get_value(self.doctype, self.name, key)
|
||||
|
||||
def get(self, key=None, filters=None, limit=None, default=None):
|
||||
if key:
|
||||
if isinstance(key, dict):
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ def send_updated_docs(doc):
|
|||
get_docinfo(doc.doctype, doc.name)
|
||||
|
||||
d = doc.as_dict()
|
||||
d["localname"] = doc.localname
|
||||
if hasattr(doc, 'localname'):
|
||||
d["localname"] = doc.localname
|
||||
|
||||
frappe.response.docs.append(d)
|
||||
frappe.response.docs.append(d)
|
||||
|
|
|
|||
|
|
@ -173,4 +173,4 @@ def get_report_list(module, is_standard="No"):
|
|||
and docstatus in (0, NULL)
|
||||
and ifnull(is_standard, "No")=%s
|
||||
and ifnull(disabled,0) != 1
|
||||
order by name""", (module, is_standard), as_dict=True)
|
||||
order by name""", (module, is_standard), as_dict=True)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue