-
-
-
+
- {% include "erpnext/templates/includes/projects/project_issues.html" %}
+ {% include "erpnext/templates/includes/projects/project_issues.html" %}
-
- {% if doc.issues|length > 9 %}
-
{{ _("More") }}
- {% endif %}
+
{{ _("More") }}
{% else %}
No Issues
{% endif %}
-
Add a new issue
-
{{ _("Time Logs") }}
diff --git a/erpnext/templates/pages/projects.js b/erpnext/templates/pages/projects.js
index 331c2d4a18..0a296af5c4 100644
--- a/erpnext/templates/pages/projects.js
+++ b/erpnext/templates/pages/projects.js
@@ -59,8 +59,13 @@ frappe.ready(function() {
},
dataType: "json",
success: function(data) {
+
+ console.log(data.message);
+ if(typeof data.message == 'undefined') {
+ $('.project-'+ item).html("No "+ item_status +" "+ item);
+ $(".more-"+ item).toggle(false);
+ }
$('.project-'+ item).html(data.message);
-
$('.project-'+ item +'-section .btn-group .bold').removeClass('bold');
$('.btn-'+ item_status +'-'+ item).addClass( "bold" );
$(".more-"+ item).toggle(true);
@@ -72,7 +77,7 @@ frappe.ready(function() {
var more_items = function(item, item_status){
if(item_status)
{
- var item_status = $('.project-'+ item +'-section .btn-group .btn-primary').hasClass('btn-closed-'+ item)
+ var item_status = $('.project-'+ item +'-section .btn-group .bold').hasClass('btn-closed-'+ item)
? 'closed' : 'open';
}
$.ajax({
@@ -87,6 +92,7 @@ frappe.ready(function() {
},
dataType: "json",
success: function(data) {
+
$(data.message).appendTo('.project-'+ item);
if(typeof data.message == 'undefined') {
$(".more-"+ item).toggle(false);
diff --git a/erpnext/templates/pages/projects.py b/erpnext/templates/pages/projects.py
index 8cec2b75c4..39648e390b 100644
--- a/erpnext/templates/pages/projects.py
+++ b/erpnext/templates/pages/projects.py
@@ -70,7 +70,7 @@ def get_tasks(project, start=0, search=None, item_status=None):
if search:
filters["subject"] = ("like", "%{0}%".format(search))
if item_status:
- filters = {"status": item_status}
+ filters["status"] = item_status
tasks = frappe.get_all("Task", filters=filters,
fields=["name", "subject", "status", "exp_start_date", "exp_end_date", "priority"],
limit_start=start, limit_page_length=10)
@@ -97,7 +97,7 @@ def get_issues(project, start=0, search=None, item_status=None):
if search:
filters["subject"] = ("like", "%{0}%".format(search))
if item_status:
- filters = {"status": item_status}
+ filters["status"] = item_status
issues = frappe.get_all("Issue", filters=filters,
fields=["name", "subject", "status", "opening_date", "resolution_date", "resolution_details"],
order_by='modified desc',