[fix] minor fixes
This commit is contained in:
parent
268e7ad644
commit
33d8db6d88
5 changed files with 9 additions and 11 deletions
|
|
@ -100,7 +100,7 @@ class Communication(Document):
|
|||
def set_sender_full_name(self):
|
||||
if not self.sender_full_name and self.sender:
|
||||
if self.sender == "Administrator":
|
||||
self.sender_full_name = self.sender
|
||||
self.sender_full_name = frappe.db.get_value("User", "Administrator", "full_name")
|
||||
self.sender = frappe.db.get_value("User", "Administrator", "email")
|
||||
elif self.sender == "Guest":
|
||||
self.sender_full_name = self.sender
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ def get_notifications_for(notification_type, config, notification_count):
|
|||
|
||||
frappe.cache().hset("notification_count:" + m, frappe.session.user, open_count[m])
|
||||
except frappe.PermissionError:
|
||||
frappe.clear_messages()
|
||||
pass
|
||||
# frappe.msgprint("Permission Error in notifications for {0}".format(m))
|
||||
|
||||
|
|
@ -94,6 +95,7 @@ def get_notifications_for_doctypes(config, notification_count):
|
|||
result = frappe.get_attr(condition)()
|
||||
|
||||
except frappe.PermissionError:
|
||||
frappe.clear_messages()
|
||||
pass
|
||||
# frappe.msgprint("Permission Error in notifications for {0}".format(d))
|
||||
|
||||
|
|
|
|||
|
|
@ -216,17 +216,13 @@ frappe.ui.form.Timeline = Class.extend({
|
|||
},
|
||||
|
||||
prepare_timeline_item: function(c) {
|
||||
if(!c.sender) c.sender = this.frm.doc.owner;
|
||||
if(!c.sender) c.sender = c.owner;
|
||||
|
||||
if(c.sender && c.sender.indexOf("<")!==-1) {
|
||||
c.sender = c.sender.split("<")[1].split(">")[0];
|
||||
}
|
||||
|
||||
if(c.sender) {
|
||||
c.user_info = frappe.user_info(c.sender);
|
||||
} else {
|
||||
c.user_info = frappe.user_info(c.owner);
|
||||
}
|
||||
c.user_info = frappe.user_info(c.sender);
|
||||
|
||||
c["delete"] = "";
|
||||
c["edit"] = "";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|| data.communication_type==="Feedback"
|
||||
|| (data.communication_type==="Comment"
|
||||
&& data.comment_type==="Comment")) { %}
|
||||
<div class="comment-header small" style="cursor: pointer;">
|
||||
<div class="comment-header small">
|
||||
<i class="{%= data.icon %} fa-fw"></i>
|
||||
<span title="{%= data.comment_by %}">{%= data.fullname %}</span>
|
||||
<span>
|
||||
|
|
|
|||
|
|
@ -147,9 +147,9 @@ class UserPermissions:
|
|||
if dt in self.can_read:
|
||||
self.can_read.remove(dt)
|
||||
|
||||
if "System Manager" in self.roles:
|
||||
self.can_import = filter(lambda d: d in self.can_create, frappe.db.sql_list("""select name from `tabDocType`
|
||||
where allow_import = 1"""))
|
||||
if "System Manager" in self.get_roles():
|
||||
self.can_import = filter(lambda d: d in self.can_create,
|
||||
frappe.db.sql_list("""select name from `tabDocType` where allow_import = 1"""))
|
||||
|
||||
def get_defaults(self):
|
||||
import frappe.defaults
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue