Bläddra i källkod

Merge branch 'hotfix'

version-14
mbauskar 8 år sedan
förälder
incheckning
e4204e9dc5
11 ändrade filer med 87 tillägg och 77 borttagningar
  1. +1
    -1
      frappe/__init__.py
  2. +3
    -4
      frappe/desk/reportview.py
  3. +1
    -0
      frappe/public/css/common.css
  4. +1
    -0
      frappe/public/css/desk.css
  5. +1
    -0
      frappe/public/css/website.css
  6. +0
    -12
      frappe/public/js/frappe/form/layout.js
  7. +57
    -53
      frappe/public/js/frappe/request.js
  8. +14
    -0
      frappe/public/js/frappe/ui/field_group.js
  9. +1
    -3
      frappe/public/js/frappe/ui/filters/filters.js
  10. +7
    -4
      frappe/public/js/frappe/ui/toolbar/notifications.js
  11. +1
    -0
      frappe/public/less/common.less

+ 1
- 1
frappe/__init__.py Visa fil

@@ -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__ = '8.5.5'
__version__ = '8.5.6'
__title__ = "Frappe Framework"

local = Local()


+ 3
- 4
frappe/desk/reportview.py Visa fil

@@ -335,10 +335,10 @@ def build_match_conditions(doctype, as_condition=True):
return match_conditions

def get_filters_cond(doctype, filters, conditions, ignore_permissions=None, with_match_conditions=False):
if filters:
if isinstance(filters, basestring):
filters = json.loads(filters)
if isinstance(filters, basestring):
filters = json.loads(filters)

if filters:
flt = filters
if isinstance(filters, dict):
filters = filters.items()
@@ -363,4 +363,3 @@ def get_filters_cond(doctype, filters, conditions, ignore_permissions=None, with
else:
cond = ''
return cond


+ 1
- 0
frappe/public/css/common.css Visa fil

@@ -89,6 +89,7 @@ kbd {
}
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;
}
.dropdown-menu {
min-width: 200px;


+ 1
- 0
frappe/public/css/desk.css Visa fil

@@ -89,6 +89,7 @@ kbd {
}
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;
}
.dropdown-menu {
min-width: 200px;


+ 1
- 0
frappe/public/css/website.css Visa fil

@@ -89,6 +89,7 @@ kbd {
}
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;
}
.dropdown-menu {
min-width: 200px;


+ 0
- 12
frappe/public/js/frappe/form/layout.js Visa fil

@@ -263,18 +263,6 @@ frappe.ui.form.Layout = Class.extend({
}
},

refresh_fields: function(fields) {
let fieldnames = fields.map((field) => {
if(field.label) return field.label;
});

this.fields_list.map(fieldobj => {
if(fieldnames.includes(fieldobj._label)) {
fieldobj.refresh();
}
});
},

refresh_section_count: function() {
this.wrapper.find(".section-count-label:visible").each(function(i) {
$(this).html(i+1);


+ 57
- 53
frappe/public/js/frappe/request.js Visa fil

@@ -158,23 +158,29 @@ frappe.request.call = function(opts) {

return $.ajax(ajax_args)
.done(function(data, textStatus, xhr) {
if(typeof data === "string") data = JSON.parse(data);
try {
if(typeof data === "string") data = JSON.parse(data);

// sync attached docs
if(data.docs || data.docinfo) {
frappe.model.sync(data);
}
// sync attached docs
if(data.docs || data.docinfo) {
frappe.model.sync(data);
}

// sync translated messages
if(data.__messages) {
$.extend(frappe._messages, data.__messages);
}
// sync translated messages
if(data.__messages) {
$.extend(frappe._messages, data.__messages);
}

// callbacks
var status_code_handler = statusCode[xhr.statusCode().status];
if (status_code_handler) {
status_code_handler(data, xhr);
// callbacks
var status_code_handler = statusCode[xhr.statusCode().status];
if (status_code_handler) {
status_code_handler(data, xhr);
}
} catch(e) {
console.log("Unable to handle response");
console.trace(e);
}
})
.always(function(data, textStatus, xhr) {
try {
@@ -208,7 +214,7 @@ frappe.request.call = function(opts) {
// call execute serverside request
frappe.request.prepare = function(opts) {
frappe.request.ajax_count++;
$("body").attr("data-ajax-state", "triggered");

// btn indicator
@@ -247,53 +253,51 @@ frappe.request.cleanup = function(opts, r) {

// un-freeze page
if(opts.freeze) frappe.dom.unfreeze();
if(r) {

if(!r) {
return;
}

// session expired? - Guest has no business here!
if(r.session_expired || frappe.get_cookie("sid")==="Guest") {
frappe.app.handle_session_expired();
return;
}
// session expired? - Guest has no business here!
if(r.session_expired || frappe.get_cookie("sid")==="Guest") {
frappe.app.handle_session_expired();
return;
}

// show messages
if(r._server_messages && !opts.silent) {
r._server_messages = JSON.parse(r._server_messages);
frappe.hide_msgprint();
frappe.msgprint(r._server_messages);
}
// show messages
if(r._server_messages && !opts.silent) {
r._server_messages = JSON.parse(r._server_messages);
frappe.hide_msgprint();
frappe.msgprint(r._server_messages);
}

// show errors
if(r.exc) {
r.exc = JSON.parse(r.exc);
if(r.exc instanceof Array) {
$.each(r.exc, function(i, v) {
if(v) {
console.log(v);
}
})
} else {
console.log(r.exc);
// show errors
if(r.exc) {
r.exc = JSON.parse(r.exc);
if(r.exc instanceof Array) {
$.each(r.exc, function(i, v) {
if(v) {
console.log(v);
}
})
} else {
console.log(r.exc);
}
}
}

// debug messages
if(r._debug_messages) {
if(opts.args) {
console.log("======== arguments ========");
console.log(opts.args);
console.log("========")
// debug messages
if(r._debug_messages) {
if(opts.args) {
console.log("======== arguments ========");
console.log(opts.args);
console.log("========")
}
$.each(JSON.parse(r._debug_messages), function(i, v) { console.log(v); });
console.log("======== response ========");
delete r._debug_messages;
console.log(r);
console.log("========");
}
$.each(JSON.parse(r._debug_messages), function(i, v) { console.log(v); });
console.log("======== response ========");
delete r._debug_messages;
console.log(r);
console.log("========");
}


frappe.last_response = r;

frappe.request.ajax_count--;


+ 14
- 0
frappe/public/js/frappe/ui/field_group.js Visa fil

@@ -45,6 +45,20 @@ frappe.ui.FieldGroup = frappe.ui.form.Layout.extend({
this.render(fields);
this.refresh_fields(fields);
},
refresh_fields: function(fields) {
let fieldnames = fields.map((field) => {
if(field.fieldname) return field.fieldname;
});

this.fields_list.map(fieldobj => {
if(fieldnames.includes(fieldobj.df.fieldname)) {
fieldobj.refresh();
if(fieldobj.df["default"]) {
fieldobj.set_input(fieldobj.df["default"]);
}
}
});
},
first_button: false,
catch_enter_as_submit: function() {
var me = this;


+ 1
- 3
frappe/public/js/frappe/ui/filters/filters.js Visa fil

@@ -11,9 +11,7 @@ frappe.ui.FilterList = Class.extend({
this.set_events();
},
make: function() {
var me = this;

this.wrapper.find('.show_filters').remove();
this.wrapper.find('.show_filters, .filter_area').remove();
this.wrapper.append(`
<div class="show_filters">
<div class="set-filters">


+ 7
- 4
frappe/public/js/frappe/ui/toolbar/notifications.js Visa fil

@@ -24,7 +24,7 @@ frappe.ui.notifications = {
this.boot_info = frappe.boot.notification_info;
let defaults = ["Comment", "ToDo", "Event"];

this.get_counts(this.boot_info.open_count_doctype, 0, defaults);
this.get_counts(this.boot_info.open_count_doctype, 1, defaults);
this.get_counts(this.boot_info.open_count_other, 1);

// Target counts are stored for docs per doctype
@@ -49,16 +49,19 @@ frappe.ui.notifications = {
},

get_counts: function(map, divide, keys, excluded = [], target = false) {
let empty_map = 1;
keys = keys ? keys
: Object.keys(map).sort().filter(e => !excluded.includes(e));
keys.map(key => {
let doc_dt = (map.doctypes) ? map.doctypes[key] : undefined;
if(map[key] > 0) {
if(map[key] > 0 || target) {
this.add_notification(key, map[key], doc_dt, target);
empty_map = 0;
}
});
if(divide)
if(divide && !empty_map) {
this.dropdown.append($('<li class="divider"></li>'));
}
},

add_notification: function(name, value, doc_dt, target = false) {
@@ -68,7 +71,7 @@ frappe.ui.notifications = {
<span class="badge pull-right">${value}</span>
</a></li>`)
: $(`<li><a class="progress-small" data-doctype="${doc_dt}"
data-doc="${name}">${label}
data-doc="${name}"><span class="dropdown-item-label">${label}<span>
<div class="progress-chart"><div class="progress">
<div class="progress-bar" style="width: ${value}%"></div>
</div></div>


+ 1
- 0
frappe/public/less/common.less Visa fil

@@ -101,6 +101,7 @@ kbd {
// dropdowns
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;
}

.dropdown-menu {


Laddar…
Avbryt
Spara