Merge pull request #3648 from rmehta/time-log-fix

[fixes] hours in time-log #3644, project buttons on condition, removed Guest permission in notification_control
This commit is contained in:
Anand Doshi
2015-07-14 11:25:46 +05:30
4 changed files with 35 additions and 35 deletions

View File

@@ -4,13 +4,6 @@
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{
"fieldname": "check_supplier_invoice_uniqueness",
"fieldtype": "Check",
"label": "Check Supplier Invoice Number Uniqueness",
"permlevel": 0,
"precision": ""
},
{ {
"default": "1", "default": "1",
"description": "If enabled, the system will post accounting entries for inventory automatically.", "description": "If enabled, the system will post accounting entries for inventory automatically.",
@@ -45,12 +38,19 @@
"label": "Credit Controller", "label": "Credit Controller",
"options": "Role", "options": "Role",
"permlevel": 0 "permlevel": 0
},
{
"fieldname": "check_supplier_invoice_uniqueness",
"fieldtype": "Check",
"label": "Check Supplier Invoice Number Uniqueness",
"permlevel": 0,
"precision": ""
} }
], ],
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2015-06-11 06:06:34.047890", "modified": "2015-07-14 00:51:48.095525",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Accounts Settings", "name": "Accounts Settings",

View File

@@ -26,22 +26,29 @@ frappe.ui.form.on("Project Task", "edit_task", function(frm, doctype, name) {
// show tasks // show tasks
cur_frm.cscript.refresh = function(doc) { cur_frm.cscript.refresh = function(doc) {
if(!doc.__islocal) { if(!doc.__islocal) {
cur_frm.add_custom_button(__("Gantt Chart"), function() { if(frappe.model.can_read("Task")) {
frappe.route_options = {"project": doc.name, "start": doc.expected_start_date, "end": doc.expected_end_date}; cur_frm.add_custom_button(__("Gantt Chart"), function() {
frappe.set_route("Gantt", "Task"); frappe.route_options = {"project": doc.name, "start": doc.expected_start_date, "end": doc.expected_end_date};
}, "icon-tasks", true); frappe.set_route("Gantt", "Task");
cur_frm.add_custom_button(__("Tasks"), function() { }, "icon-tasks", true);
frappe.route_options = {"project": doc.name} cur_frm.add_custom_button(__("Tasks"), function() {
frappe.set_route("List", "Task"); frappe.route_options = {"project": doc.name}
}, "icon-list", true); frappe.set_route("List", "Task");
cur_frm.add_custom_button(__("Time Logs"), function() { }, "icon-list", true);
frappe.route_options = {"project": doc.name} }
frappe.set_route("List", "Time Log"); if(frappe.model.can_read("Time Log")) {
}, "icon-list", true); cur_frm.add_custom_button(__("Time Logs"), function() {
cur_frm.add_custom_button(__("Expense Claims"), function() { frappe.route_options = {"project": doc.name}
frappe.route_options = {"project": doc.name} frappe.set_route("List", "Time Log");
frappe.set_route("List", "Expense Claim"); }, "icon-list", true);
}, "icon-list", true); }
if(frappe.model.can_read("Expense Claim")) {
cur_frm.add_custom_button(__("Expense Claims"), function() {
frappe.route_options = {"project": doc.name}
frappe.set_route("List", "Expense Claim");
}, "icon-list", true);
}
} }
} }
@@ -56,5 +63,5 @@ cur_frm.fields_dict['sales_order'].get_query = function(doc) {
filters:{ filters:{
'project_name': doc.name 'project_name': doc.name
} }
} }
} }

View File

@@ -42,7 +42,7 @@ frappe.ui.form.on("Time Log", "before_save", function(frm) {
frappe.ui.form.on("Time Log", "to_time", function(frm) { frappe.ui.form.on("Time Log", "to_time", function(frm) {
if(frm._setting_hours) return; if(frm._setting_hours) return;
frm.set_value("hours", moment(cur_frm.doc.to_time).diff(moment(cur_frm.doc.from_time), frm.set_value("hours", moment(cur_frm.doc.to_time).diff(moment(cur_frm.doc.from_time),
"hours")); "minutes") / 60);
}); });
@@ -98,5 +98,5 @@ cur_frm.fields_dict['task'].get_query = function(doc) {
filters:{ filters:{
'project': doc.project 'project': doc.project
} }
} }
} }

View File

@@ -176,19 +176,12 @@
"icon": "icon-envelope", "icon": "icon-envelope",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2015-03-04 01:13:46.715113", "modified": "2015-07-13 06:24:05.436127",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Notification Control", "name": "Notification Control",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{
"create": 0,
"permlevel": 0,
"read": 1,
"role": "Guest",
"write": 0
},
{ {
"create": 1, "create": 1,
"permlevel": 0, "permlevel": 0,