Esempio n. 1
0
    def update_list_settings(self):
        # update list settings if new search
        list_settings = json.loads(get_list_settings(self.doctype) or '{}')
        list_settings['filters'] = self.filters
        list_settings['limit'] = self.limit_page_length
        list_settings['order_by'] = self.order_by

        if self.save_list_settings_fields:
            list_settings['fields'] = self.list_settings_fields

        update_list_settings(self.doctype, list_settings)
Esempio n. 2
0
	def update_list_settings(self):
		# update list settings if new search
		list_settings = json.loads(get_list_settings(self.doctype) or '{}')
		list_settings['filters'] = self.filters
		list_settings['limit'] = self.limit_page_length
		list_settings['order_by'] = self.order_by

		if self.save_list_settings_fields:
			list_settings['fields'] = self.list_settings_fields

		update_list_settings(self.doctype, list_settings)
Esempio n. 3
0
def getdoctype(doctype, with_parent=False, cached_timestamp=None):
	"""load doctype"""

	docs = []
	parent_dt = None

	# with parent (called from report builder)
	if with_parent:
		parent_dt = frappe.model.meta.get_parent_dt(doctype)
		if parent_dt:
			docs = get_meta_bundle(parent_dt)
			frappe.response['parent_dt'] = parent_dt

	if not docs:
		docs = get_meta_bundle(doctype)

	frappe.response['user_permissions'] = get_user_permissions(docs)
	frappe.response['list_settings'] = get_list_settings(parent_dt or doctype)

	if cached_timestamp and docs[0].modified==cached_timestamp:
		return "use_cache"

	frappe.response.docs.extend(docs)
Esempio n. 4
0
def getdoctype(doctype, with_parent=False, cached_timestamp=None):
    """load doctype"""

    docs = []
    parent_dt = None

    # with parent (called from report builder)
    if with_parent:
        parent_dt = frappe.model.meta.get_parent_dt(doctype)
        if parent_dt:
            docs = get_meta_bundle(parent_dt)
            frappe.response['parent_dt'] = parent_dt

    if not docs:
        docs = get_meta_bundle(doctype)

    frappe.response['user_permissions'] = get_user_permissions(docs)
    frappe.response['list_settings'] = get_list_settings(parent_dt or doctype)

    if cached_timestamp and docs[0].modified == cached_timestamp:
        return "use_cache"

    frappe.response.docs.extend(docs)
Esempio n. 5
0
def update_dashboard_settings(doctype, dashboard_age_fieldname, dashboard_age_value):
	list_settings = json.loads(get_list_settings(doctype) or '{}')
	list_settings['dashboard_age_fieldname'] = dashboard_age_fieldname
	list_settings['dashboard_age_value'] = dashboard_age_value

	update_list_settings(doctype, list_settings)