Merge branch 'version-12-hotfix' into version-12

This commit is contained in:
Sahil Khan 2019-08-20 15:59:28 +05:30
commit 3d2e570553
7 changed files with 36 additions and 7 deletions

View file

@ -23,7 +23,7 @@ if sys.version[0] == '2':
reload(sys)
sys.setdefaultencoding("utf-8")
__version__ = '12.0.6'
__version__ = '12.0.7'
__title__ = "Frappe Framework"
local = Local()

View file

@ -120,8 +120,15 @@ def user_permission_exists(user, allow, for_value, applicable_for=None):
return has_same_user_permission
def get_applicable_for_doctype_list(doctype, txt, searchfield, start, page_len, filters):
linked_doctypes = get_linked_doctypes(doctype, True).keys()
linked_doctypes = list(linked_doctypes)
linked_doctypes_map = get_linked_doctypes(doctype, True)
linked_doctypes = []
for linked_doctype, linked_doctype_values in linked_doctypes_map.items():
linked_doctypes.append(linked_doctype)
child_doctype = linked_doctype_values.get("child_doctype")
if child_doctype:
linked_doctypes.append(child_doctype)
linked_doctypes += [doctype]
if txt:

View file

@ -36,6 +36,18 @@ frappe.ui.form.on('Dashboard Chart', {
frm.trigger('update_options');
},
timespan: function(frm) {
const time_interval_options = {
"Last Year": ["Quarterly", "Monthly", "Weekly", "Daily"],
"Last Quarter": ["Monthly", "Weekly", "Daily"],
"Last Month": ["Weekly", "Daily"],
"Last Week": ["Daily"]
};
if (frm.doc.timespan) {
frm.set_df_property('time_interval', 'options', time_interval_options[frm.doc.timespan]);
}
},
update_options: function(frm) {
let doctype = frm.doc.document_type;
let date_fields = [

View file

@ -13,7 +13,7 @@ def get_preview_data(doctype, docname):
# no preview fields defined, build list from mandatory fields
if not preview_fields:
preview_fields = [field.name for field in meta.fields if field.reqd]
preview_fields = [field.fieldname for field in meta.fields if field.reqd]
title_field = meta.get_title_field()
image_field = meta.image_field
@ -40,4 +40,4 @@ def get_preview_data(doctype, docname):
if val and meta.has_field(key) and key not in [image_field, title_field, 'name']:
formatted_preview_data[meta.get_field(key).label] = frappe.format(val, meta.get_field(key).fieldtype)
return formatted_preview_data
return formatted_preview_data

View file

@ -3494,7 +3494,7 @@ tbody.collapse.in {
right: 0;
bottom: 0;
left: 0;
z-index: 990;
z-index: 99;
}
.pull-right > .dropdown-menu {
right: 0;

View file

@ -984,7 +984,13 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
}
setup_new_doc_event() {
this.$no_result.find('.btn-new-doc').click(() => this.make_new_doc());
this.$no_result.find('.btn-new-doc').click(() => {
if (this.settings.primary_action) {
this.settings.primary_action();
} else {
this.make_new_doc();
}
});
}
setup_tag_event() {

View file

@ -107,6 +107,10 @@ kbd {
/* dropdowns */
.dropdown-backdrop {
display: none;
}
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;