[cleanup] projects
This commit is contained in:
parent
8497784c4c
commit
cb144bfcd4
@ -239,7 +239,7 @@ class LeaveApplication(Document):
|
|||||||
|
|
||||||
def notify(self, args):
|
def notify(self, args):
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
from frappe.desk.page.messages.messages import post
|
from frappe.desk.page.chat.chat import post
|
||||||
post(**{"txt": args.message, "contact": args.message_to, "subject": args.subject,
|
post(**{"txt": args.message, "contact": args.message_to, "subject": args.subject,
|
||||||
"notify": cint(self.follow_via_email)})
|
"notify": cint(self.follow_via_email)})
|
||||||
|
|
||||||
|
@ -11,6 +11,57 @@ frappe.ui.form.on("Project", {
|
|||||||
"project_name": frm.doc.name
|
"project_name": frm.doc.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frm.set_query('customer', 'erpnext.controllers.queries.customer_query');
|
||||||
|
|
||||||
|
// sales order
|
||||||
|
frm.set_query('sales_order', function() {
|
||||||
|
var filters = {
|
||||||
|
'project': ["in", frm.doc.__islocal ? [""] : [frm.doc.name, ""]]
|
||||||
|
};
|
||||||
|
|
||||||
|
if (frm.doc.customer) {
|
||||||
|
filters["customer"] = frm.doc.customer;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
filters: filters
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
refresh: function(frm) {
|
||||||
|
if(frm.doc.__islocal) {
|
||||||
|
frm.web_link && frm.web_link.remove();
|
||||||
|
} else {
|
||||||
|
frm.add_web_link("/projects?project=" + encodeURIComponent(frm.doc.name));
|
||||||
|
|
||||||
|
if(frappe.model.can_read("Task")) {
|
||||||
|
frm.add_custom_button(__("Gantt Chart"), function() {
|
||||||
|
frappe.route_options = {"project": frm.doc.name,
|
||||||
|
"start": frm.doc.expected_start_date, "end": frm.doc.expected_end_date};
|
||||||
|
frappe.set_route("Gantt", "Task");
|
||||||
|
}, __("View"), true);
|
||||||
|
frm.add_custom_button(__("Tasks"), function() {
|
||||||
|
frappe.route_options = {"project": frm.doc.name}
|
||||||
|
frappe.set_route("List", "Task");
|
||||||
|
}, __("View"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(frappe.model.can_read("Time Log")) {
|
||||||
|
frm.add_custom_button(__("Time Logs"), function() {
|
||||||
|
frappe.route_options = {"project": frm.doc.name}
|
||||||
|
frappe.set_route("List", "Time Log");
|
||||||
|
}, __("View"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(frappe.model.can_read("Expense Claim")) {
|
||||||
|
frm.add_custom_button(__("Expense Claims"), function() {
|
||||||
|
frappe.route_options = {"project": frm.doc.name}
|
||||||
|
frappe.set_route("List", "Expense Claim");
|
||||||
|
}, __("View"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -23,51 +74,3 @@ frappe.ui.form.on("Project Task", "edit_task", function(frm, doctype, name) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// show tasks
|
|
||||||
cur_frm.cscript.refresh = function(doc) {
|
|
||||||
if(!doc.__islocal) {
|
|
||||||
if(frappe.model.can_read("Task")) {
|
|
||||||
cur_frm.add_custom_button(__("Gantt Chart"), function() {
|
|
||||||
frappe.route_options = {"project": doc.name, "start": doc.expected_start_date, "end": doc.expected_end_date};
|
|
||||||
frappe.set_route("Gantt", "Task");
|
|
||||||
}, __("View"), true);
|
|
||||||
cur_frm.add_custom_button(__("Tasks"), function() {
|
|
||||||
frappe.route_options = {"project": doc.name}
|
|
||||||
frappe.set_route("List", "Task");
|
|
||||||
}, __("View"), true);
|
|
||||||
}
|
|
||||||
if(frappe.model.can_read("Time Log")) {
|
|
||||||
cur_frm.add_custom_button(__("Time Logs"), function() {
|
|
||||||
frappe.route_options = {"project": doc.name}
|
|
||||||
frappe.set_route("List", "Time Log");
|
|
||||||
}, __("View"), 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");
|
|
||||||
}, __("View"), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
query: "erpnext.controllers.queries.customer_query"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.fields_dict['sales_order'].get_query = function(doc) {
|
|
||||||
var filters = {
|
|
||||||
'project': ["in", doc.__islocal ? [""] : [doc.name, ""]]
|
|
||||||
};
|
|
||||||
|
|
||||||
if (doc.customer) {
|
|
||||||
filters["customer"] = doc.customer;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
filters: filters
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -352,6 +352,7 @@
|
|||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"description": "Project will be accessible on the website to these users",
|
||||||
"fieldname": "users",
|
"fieldname": "users",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -965,14 +966,14 @@
|
|||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "icon-puzzle-piece",
|
"icon": "icon-puzzle-piece",
|
||||||
"idx": 1,
|
"idx": 24,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
"in_dialog": 0,
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 4,
|
"max_attachments": 4,
|
||||||
"modified": "2016-03-25 06:46:29.485193",
|
"modified": "2016-03-31 01:34:05.703925",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Project",
|
"name": "Project",
|
||||||
|
@ -163,7 +163,7 @@ def get_list_context(context=None):
|
|||||||
return {
|
return {
|
||||||
"title": _("My Projects"),
|
"title": _("My Projects"),
|
||||||
"get_list": get_project_list,
|
"get_list": get_project_list,
|
||||||
"row_template": "templates/includes/project_row.html"
|
"row_template": "templates/includes/projects/project_row.html"
|
||||||
}
|
}
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
{% if doc.percent_complete %}
|
{% if doc.percent_complete %}
|
||||||
<div class="progress" style="margin-bottom: 0!important; margin-top: 10px!important; height:5px;">
|
<div class="progress" style="margin-bottom: 0!important; margin-top: 10px!important; height:5px;">
|
||||||
<div class="progress-bar progress-bar-warning" role="progressbar"
|
<div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success"}}" role="progressbar"
|
||||||
aria-valuenow="{{ doc.percent_complete|round|int }}"
|
aria-valuenow="{{ doc.percent_complete|round|int }}"
|
||||||
aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
|
aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
|
||||||
</div>
|
</div>
|
@ -1,17 +0,0 @@
|
|||||||
{% for timeline in doc.timelines %}
|
|
||||||
<article class="timeline-entry">
|
|
||||||
<div class="timeline-entry-inner">
|
|
||||||
<div class="timeline-icon {{ "bg-danger" if ((timeline.reference_name).startswith('ISS') and (timeline.subject).startswith('Open')) else "bg-warning" if ((timeline.reference_name).startswith('TASK') and (timeline.subject).startswith('Open')) else "bg-success" if (timeline.subject).startswith('Closed') else "bg-info"}}">
|
|
||||||
</div>
|
|
||||||
<div class="timeline-label">
|
|
||||||
<span class="avatar avatar-small" title="{{ timeline.modified_by }}"> <img src="{{ timeline.user_image }}"></span>
|
|
||||||
<span class='indicator'>
|
|
||||||
{{timeline.reference_name}} {{timeline.subject }}
|
|
||||||
</span>
|
|
||||||
<span class='indicator pull-right'>
|
|
||||||
{{ frappe.utils.pretty_date(timeline.creation) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
{% endfor %}
|
|
@ -38,7 +38,7 @@
|
|||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
{% if doc.percent_complete %}
|
{% if doc.percent_complete %}
|
||||||
<div class="progress progress-hg">
|
<div class="progress progress-hg">
|
||||||
<div class="progress-bar progress-bar-warning active" role="progressbar"
|
<div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success" }} active" role="progressbar"
|
||||||
aria-valuenow="{{ doc.percent_complete|round|int }}"
|
aria-valuenow="{{ doc.percent_complete|round|int }}"
|
||||||
aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
|
aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user