Merge branch 'hotfix'

This commit is contained in:
Nabin Hait 2018-02-07 16:03:28 +05:30
commit 408c2f8c61
6 changed files with 17 additions and 3 deletions

View file

@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template
__version__ = '10.0.20'
__version__ = '10.0.21'
__title__ = "Frappe Framework"
local = Local()

View file

@ -396,6 +396,10 @@ class Database:
conditions.append(condition)
if isinstance(filters, int):
# docname is a number, convert to string
filters = str(filters)
if isinstance(filters, string_types):
filters = { "name": filters }
@ -611,7 +615,7 @@ class Database:
order_by = ("order by " + order_by) if order_by else ""
r = self.sql("select {0} from `tab{1}` {2} {3} {4}"
.format(fl, doctype, "where" if conditions else "", conditions, order_by), values,
.format(fl, doctype, "where" if conditions else "", conditions, order_by), values,
as_dict=as_dict, debug=debug, update=update)
return r

View file

@ -723,6 +723,7 @@ body[data-route^="Form/Communication"] textarea[data-fieldname="subject"] {
margin-top: 5px;
}
.frappe-control[data-fieldtype="Attach"] .attached-file .close {
margin-right: -7px;
position: absolute;
top: 0;
right: 0;

View file

@ -237,6 +237,7 @@ frappe.ui.get_upload_dialog = function(opts){
dialog.$wrapper.find('[name="file_url"]').val(r.message.file_url);
dialog.$wrapper.find('.private-file input').prop('checked', r.message.is_private);
opts.args.filename = r.message.file_name;
opts.args.is_private = r.message.is_private;
}
});
}

View file

@ -508,6 +508,14 @@ frappe.ui.form.Grid = Class.extend({
}
df.colsize = colsize;
}
// attach formatter on refresh
if (df.fieldtype == 'Link' && !df.formatter) {
const docfield = frappe.meta.docfield_map[df.parent][df.fieldname];
if (docfield && docfield.formatter) {
df.formatter = docfield.formatter;
}
}
total_colsize += df.colsize;
if(total_colsize > 11)

View file

@ -433,7 +433,7 @@ _f.Frm.prototype.set_indicator_formatter = function(fieldname, get_color, get_te
})
}
frappe.meta.get_docfield(doctype, fieldname, this.doc.name).formatter =
frappe.meta.docfield_map[doctype][fieldname].formatter =
function(value, df, options, doc) {
if(value) {
return repl('<a class="indicator %(color)s" href="#Form/%(doctype)s/%(name)s">%(label)s</a>', {