Merge branch 'v5.0' of https://github.com/frappe/frappe into v5.0

This commit is contained in:
Nabin Hait 2015-02-26 15:19:21 +05:30
commit 9b217ecaeb
4 changed files with 19 additions and 11 deletions

View file

@ -173,7 +173,6 @@ class DocType(Document):
if not (self.istable or self.issingle):
make_boilerplate("test_controller.py", self)
make_boilerplate("test_records.json", self)
def make_amendable(self):
"""If is_submittable is set, add amended_from docfields."""

View file

@ -6,6 +6,7 @@
<option value="=">{%= __("Equals") %}</option>
<option value="like">{%= __("Like") %}</option>
<option value="in">{%= __("In") %}</option>
<option value="not in">{%= __("Not In") %}</option>
<option value="!=">{%= __("Not Equals") %}</option>
<option value=">">{%= __(">") %}</option>
<option value="<">{%= __("<") %}</option>

View file

@ -145,13 +145,13 @@ frappe.ui.Filter = Class.extend({
// add help for "in" codition
me.$w.find('.condition').change(function() {
var condition = $(this).val();
if(in_list(["in", "like"], condition)) {
if(in_list(["in", "like", "not in"], condition)) {
me.set_field(me.field.df.parent, me.field.df.fieldname, 'Data', condition);
if(!me.field.desc_area) {
me.field.desc_area = $('<div class="text-muted small">').appendTo(me.field.wrapper);
}
// set description
me.field.desc_area.html((condition==="in"
me.field.desc_area.html((in_list(["in", "not in"], condition)==="in"
? __("values separated by commas")
: __("use % as wildcard"))+'</div>');
} else {
@ -310,7 +310,9 @@ frappe.ui.Filter = Class.extend({
if ((val.length === 0) || (val.lastIndexOf("%") !== (val.length - 1))) {
val = (val || "") + '%';
}
} else if(val === '%') val = "";
} else if(in_list(["in", "not in"], this.get_condition())) {
val = $.map(val.split(","), function(v) { return strip(v); });
} if(val === '%') val = "";
return val;
},

View file

@ -70,15 +70,21 @@ frappe.ui.TagEditor = Class.extend({
return;
me.refreshing = true;
me.$tags.tagit("removeAll");
try {
me.$tags.tagit("removeAll");
if(!user_tags && this.frm)
user_tags = frappe.model.get_value(this.frm.doctype, this.frm.docname, "_user_tags");
if(!user_tags && this.frm)
user_tags = frappe.model.get_value(this.frm.doctype, this.frm.docname, "_user_tags");
if(user_tags) {
$.each(user_tags.split(','), function(i, v) {
me.$tags.tagit("createTag", v);
});
if(user_tags) {
$.each(user_tags.split(','), function(i, v) {
me.$tags.tagit("createTag", v);
});
}
} catch(e) {
me.refreshing = false;
// wtf bug
setTimeout( function() { me.refresh(); }, 100);
}
me.refreshing = false;