Merge branch 'master' of github.com:webnotes/wnframework
This commit is contained in:
commit
f0ba3e7f4d
8 changed files with 17 additions and 15 deletions
|
|
@ -177,7 +177,7 @@ class DocType:
|
|||
def validate_fields_for_doctype(doctype):
|
||||
from webnotes.model.doctype import get
|
||||
validate_fields(filter(lambda d: d.doctype=="DocField" and d.parent==doctype,
|
||||
get(doctype)))
|
||||
get(doctype, cached=False)))
|
||||
|
||||
def validate_fields(fields):
|
||||
def check_illegal_characters(fieldname):
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ function flt(v,decimals) {
|
|||
if(isNaN(v))
|
||||
v=0;
|
||||
if(decimals!=null)
|
||||
return parseFloat(v.toFixed(decimals));
|
||||
return roundNumber(v, decimals);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -569,13 +569,13 @@ LinkField.prototype.make_input = function() {
|
|||
}
|
||||
|
||||
me.onrefresh = function() {
|
||||
$(me.btn2).toggle(in_list(wn.boot.profile.can_create, me.df.options))
|
||||
$(me.btn1).toggle(me.df.options=='[Select]');
|
||||
$(me.btn2).toggle(in_list(wn.boot.profile.can_create, me.df.options));
|
||||
$(me.btn1).toggle(in_list(wn.boot.profile.can_read, me.df.options));
|
||||
}
|
||||
|
||||
me.onrefresh();
|
||||
|
||||
me.txt.field_object = this;
|
||||
me.txt.field_object = this;
|
||||
// set onchange triggers
|
||||
|
||||
me.input.set_input = function(val) {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ _f.FrmHeader = Class.extend({
|
|||
$(repl('<span class="avatar avatar avatar-small">\
|
||||
<img title="%(created_by)s" src="%(avatar_created)s"/></span>\
|
||||
<span class="avatar avatar avatar-small">\
|
||||
<img title="%(created_by)s" src="%(avatar_created)s"/></span>', {
|
||||
<img title="%(modified_by)s" src="%(avatar_modified)s"/></span>', {
|
||||
created_by: wn.user_info(doc.owner).fullname,
|
||||
avatar_created: wn.user_info(doc.owner).image,
|
||||
modified_by: wn.user_info(doc.modified_by).fullname,
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ $.extend(_p, {
|
|||
}
|
||||
var finished = header
|
||||
+ stat
|
||||
+ container.innerHTML.replace(/<div/g, '\n<div').replace(/<td/g, '\n<td')
|
||||
+ container.innerHTML
|
||||
+ footer;
|
||||
|
||||
// replace relative links by absolute links
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ wn.form.formatters = {
|
|||
return value==null ? "" : value
|
||||
},
|
||||
Float: function(value) {
|
||||
return flt(value).toFixed(6);
|
||||
return flt(value, 6);
|
||||
},
|
||||
Int: function(value) {
|
||||
return cint(value);
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ wn.print.Table = Class.extend({
|
|||
var df = wn.meta.docfield_map[me.tabletype][fieldname];
|
||||
var label = df ? df.label : fieldname;
|
||||
}
|
||||
$("<th>").html(label)
|
||||
$("<td>").html(label)
|
||||
.appendTo(headrow)
|
||||
.css(me.head_cell_style)
|
||||
.css({"width": me.widths[ci] + "%"});
|
||||
|
|
@ -170,7 +170,8 @@ wn.print.Table = Class.extend({
|
|||
cell_style: {
|
||||
border: '1px solid #999',
|
||||
padding: '3px',
|
||||
'vertical-align': 'top'
|
||||
'vertical-align': 'top',
|
||||
'word-wrap': 'break-word',
|
||||
},
|
||||
|
||||
head_cell_style: {
|
||||
|
|
@ -178,7 +179,8 @@ wn.print.Table = Class.extend({
|
|||
padding: '3px',
|
||||
'vertical-align': 'top',
|
||||
'background-color': '#ddd',
|
||||
'font-weight': 'bold'
|
||||
'font-weight': 'bold',
|
||||
'word-wrap': 'break-word',
|
||||
},
|
||||
|
||||
table_style: {
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ import webnotes.model.doclist
|
|||
doctype_cache = {}
|
||||
docfield_types = None
|
||||
|
||||
def get(doctype, processed=False):
|
||||
def get(doctype, processed=False, cached=True):
|
||||
"""return doclist"""
|
||||
|
||||
doclist = from_cache(doctype, processed)
|
||||
if doclist: return DocTypeDocList(doclist)
|
||||
if cached:
|
||||
doclist = from_cache(doctype, processed)
|
||||
if doclist: return DocTypeDocList(doclist)
|
||||
|
||||
load_docfield_types()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue