From 5d39a9594dd7fe262049582834e7d8deb2ce55b6 Mon Sep 17 00:00:00 2001
From: Nabin Hait
Date: Wed, 9 Dec 2015 17:06:09 +0530
Subject: [PATCH 1/9] [fix] Reload SO Item in patch
---
erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py b/erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py
index 23de9d05202..9a53b7f5d39 100644
--- a/erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py
+++ b/erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py
@@ -2,6 +2,7 @@ from __future__ import unicode_literals
import frappe
def execute():
+ frappe.reload_doctype("Sales Order Item")
for so_name in frappe.db.sql("""select distinct parent from `tabSales Order Item`
where delivered_by_supplier=1 and docstatus=1"""):
so = frappe.get_doc("Sales Order", so_name[0])
From 2af44ffd06d65fee8e8b853db419f1b6987bd961 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Wed, 9 Dec 2015 17:28:51 +0530
Subject: [PATCH 2/9] [fix] setup wizard is_private
---
.../erpnext.controllers.status_updater.html | 2 +-
.../erpnext.shopping_cart.cart.html | 16 ++
erpnext/docs/current/index.html | 2 +-
.../accounts/bank_reconciliation_detail.html | 12 ++
.../models/accounts/purchase_invoice.html | 156 ++++++++----------
.../purchase_taxes_and_charges_template.html | 9 -
.../sales_taxes_and_charges_template.html | 9 -
.../current/models/buying/purchase_order.html | 150 +++++++----------
.../docs/current/models/buying/supplier.html | 53 ++----
.../models/buying/supplier_quotation.html | 100 +++++------
.../docs/current/models/selling/customer.html | 71 +++-----
.../current/models/selling/sales_order.html | 2 +-
.../models/stock/material_request.html | 36 ++--
.../models/stock/purchase_receipt.html | 136 +++++++--------
.../current/models/utilities/address.html | 28 ++++
erpnext/public/js/setup_wizard.js | 11 +-
16 files changed, 348 insertions(+), 445 deletions(-)
diff --git a/erpnext/docs/current/api/controllers/erpnext.controllers.status_updater.html b/erpnext/docs/current/api/controllers/erpnext.controllers.status_updater.html
index 05fd9ce42c3..eb34f9bfb78 100644
--- a/erpnext/docs/current/api/controllers/erpnext.controllers.status_updater.html
+++ b/erpnext/docs/current/api/controllers/erpnext.controllers.status_updater.html
@@ -75,7 +75,7 @@ Installation Note: Update Installed Qty, Update Percent Qty and Validate over in
set_status
- (self, update=False, status=None)
+ (self, update=False, status=None, update_modified=True)
- | 89 |
+ 88 |
lr_date |
Date |
diff --git a/erpnext/docs/current/models/utilities/address.html b/erpnext/docs/current/models/utilities/address.html
index 22c349e87be..d02b36a8049 100644
--- a/erpnext/docs/current/models/utilities/address.html
+++ b/erpnext/docs/current/models/utilities/address.html
@@ -412,6 +412,20 @@ Other
+
+
+
+ __setup__
+ (self)
+
+
+
+
+
+
+
+
@@ -440,6 +454,20 @@ Other
+
+
+
+ check_if_linked
+ (self)
+
+
+
+
+
+
+
+
diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js
index c139f8a7178..ec70bbb62b4 100644
--- a/erpnext/public/js/setup_wizard.js
+++ b/erpnext/public/js/setup_wizard.js
@@ -109,7 +109,7 @@ function load_erpnext_slides() {
{"fieldname": "password", "label": __("Password"), "fieldtype": "Password",
reqd:1},
{fieldtype:"Attach Image", fieldname:"attach_user",
- label: __("Attach Your Picture")},
+ label: __("Attach Your Picture"), is_private: 0},
],
help: __('The first user will become the System Manager (you can change this later).'),
onload: function(slide) {
@@ -254,12 +254,15 @@ function load_erpnext_slides() {
fields: [
{fieldtype:"Attach Image", fieldname:"attach_letterhead",
label: __("Attach Letterhead"),
- description: __("Keep it web friendly 900px (w) by 100px (h)")
+ description: __("Keep it web friendly 900px (w) by 100px (h)"),
+ is_private: 0
},
{fieldtype: "Column Break"},
{fieldtype:"Attach Image", fieldname:"attach_logo",
label:__("Attach Logo"),
- description: __("100px by 100px")},
+ description: __("100px by 100px"),
+ is_private: 0
+ },
],
css_class: "two-column"
@@ -381,7 +384,7 @@ function load_erpnext_slides() {
{fieldtype: "Check", fieldname: "is_purchase_item_" + i, label:__("We buy this Item")},
{fieldtype:"Column Break"},
{fieldtype:"Currency", fieldname:"item_price_" + i, label:__("Rate")},
- {fieldtype:"Attach Image", fieldname:"item_img_" + i, label:__("Attach Image")},
+ {fieldtype:"Attach Image", fieldname:"item_img_" + i, label:__("Attach Image"), is_private: 0},
])
}
slide.fields[1].reqd = 1;
From c819fd4ee8981f438470b6b91026e08cac41c709 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Thu, 10 Dec 2015 10:34:32 +0530
Subject: [PATCH 3/9] [translations] for #4461
---
.../manufacturing_settings.json | 33 +++++++++++++++++--
.../doctype/activity_type/activity_type.js | 2 +-
2 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
index 61ce9e85b78..5465705d921 100644
--- a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
+++ b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
@@ -19,10 +19,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Capacity Planning",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -34,7 +36,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "Disables creation of time logs against Production Orders.\nOperations shall not be tracked against Production Order",
+ "description": "Disables creation of time logs against Production Orders. Operations shall not be tracked against Production Order",
"fieldname": "disable_capacity_planning",
"fieldtype": "Check",
"hidden": 0,
@@ -42,10 +44,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Disable Capacity Planning and Time Tracking",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -65,10 +69,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Overtime",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -88,11 +94,13 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Allow Production on Holidays",
+ "length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -110,10 +118,12 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -134,10 +144,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Capacity Planning For (Days)",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -157,10 +169,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Time Between Operations (in mins)",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -178,10 +192,12 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -200,10 +216,12 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Over Production Allowance Percentage",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -223,11 +241,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Backflush Raw Materials Based On",
+ "length": 0,
"no_copy": 0,
"options": "BOM\nMaterial Transferred for Manufacture",
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -245,10 +265,12 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -267,11 +289,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Default Work In Progress Warehouse",
+ "length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -290,11 +314,13 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Default Finished Goods Warehouse",
+ "length": 0,
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -306,12 +332,15 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-wrench",
+ "idx": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-08-21 08:27:03.794133",
+ "max_attachments": 0,
+ "menu_index": 0,
+ "modified": "2015-12-10 00:03:20.895790",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Manufacturing Settings",
diff --git a/erpnext/projects/doctype/activity_type/activity_type.js b/erpnext/projects/doctype/activity_type/activity_type.js
index f7bb9a52226..7eb3571af10 100644
--- a/erpnext/projects/doctype/activity_type/activity_type.js
+++ b/erpnext/projects/doctype/activity_type/activity_type.js
@@ -1,6 +1,6 @@
frappe.ui.form.on("Activity Type", {
refresh: function(frm) {
- frm.add_custom_button("Activity Cost per Employee", function() {
+ frm.add_custom_button(__("Activity Cost per Employee"), function() {
frappe.route_options = {"activity_type": frm.doc.name};
frappe.set_route("List", "Activity Cost");
});
From a5cf8a86c15a64643cd63cc5007e4da597541ae2 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Thu, 10 Dec 2015 10:38:46 +0530
Subject: [PATCH 4/9] [minor] lang fixes for email digest
---
erpnext/setup/doctype/email_digest/templates/default.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/erpnext/setup/doctype/email_digest/templates/default.html b/erpnext/setup/doctype/email_digest/templates/default.html
index 44c0490eca1..7ed9d1faaf2 100644
--- a/erpnext/setup/doctype/email_digest/templates/default.html
+++ b/erpnext/setup/doctype/email_digest/templates/default.html
@@ -76,7 +76,7 @@
|
- {{ t.description }}
+ {{ _(t.description) }}
|
@@ -99,7 +99,7 @@
|
- {{ n.key }}
+ {{ _(n.key) }}
|
From 533aba02c5fddb754020fad8514cdcc3ae688cd1 Mon Sep 17 00:00:00 2001
From: Nabin Hait
Date: Thu, 10 Dec 2015 10:50:35 +0530
Subject: [PATCH 5/9] [fix] Payment days calculation in salary slip
---
erpnext/hr/doctype/salary_slip/salary_slip.js | 2 +-
erpnext/hr/doctype/salary_slip/salary_slip.py | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index 9ed5c764f24..f2e5a9ed689 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -32,7 +32,7 @@ cur_frm.cscript.month = cur_frm.cscript.employee = cur_frm.cscript.fiscal_year;
cur_frm.cscript.leave_without_pay = function(doc,dt,dn){
if (doc.employee && doc.fiscal_year && doc.month) {
- return $c_obj(doc, 'get_leave_details',doc.leave_without_pay,function(r, rt) {
+ return $c_obj(doc, 'get_leave_details', {"lwp": doc.leave_without_pay}, function(r, rt) {
var doc = locals[dt][dn];
cur_frm.refresh();
calculate_all(doc, dt, dn);
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index 818c95e324e..671fbb888aa 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -90,14 +90,14 @@ class SalarySlip(TransactionBase):
start_date = joining_date
elif joining_date > month['month_end_date']:
return
-
+
+ end_date = month['month_end_date']
if relieving_date:
if relieving_date > start_date and relieving_date < month['month_end_date']:
end_date = relieving_date
elif relieving_date < month['month_start_date']:
- frappe.throw(_("Employee relieved on {0} must be set as 'Left'").format(relieving_date))
- else:
- end_date = month['month_end_date']
+ frappe.throw(_("Employee relieved on {0} must be set as 'Left'")
+ .format(relieving_date))
payment_days = date_diff(end_date, start_date) + 1
From b3051ab84d919e424de8b1831436ce00ecf2c09b Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 10 Dec 2015 11:46:20 +0530
Subject: [PATCH 6/9] [fix] validate that Item's website image is public
---
erpnext/stock/doctype/item/item.js | 3 +++
erpnext/stock/doctype/item/item.py | 28 +++++++++++++++++++++++++---
2 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index d712cc91a3b..55295f4c028 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -10,6 +10,9 @@ frappe.ui.form.on("Item", {
frm.fields_dict["attributes"].grid.set_column_disp("attribute_value", true);
}
+ // should never check Private
+ frm.fields_dict["website_image"].df.is_private = 0;
+
},
refresh: function(frm) {
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index dfd281a9aa9..6bdafcf3852 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -47,8 +47,6 @@ class Item(WebsiteGenerator):
if not self.stock_uom:
msgprint(_("Please enter default Unit of Measure"), raise_exception=1)
- if self.image and not self.website_image:
- self.website_image = self.image
self.check_warehouse_is_set_for_stock_item()
self.validate_uom()
@@ -68,6 +66,7 @@ class Item(WebsiteGenerator):
self.validate_has_variants()
self.validate_attributes()
self.validate_variant_attributes()
+ self.validate_website_image()
self.make_thumbnail()
if not self.get("__islocal"):
@@ -83,6 +82,29 @@ class Item(WebsiteGenerator):
self.update_variants()
self.update_template_item()
+ def validate_website_image(self):
+ """Validate if the website image is a public file"""
+ auto_set_website_image = False
+ if not self.website_image and self.image:
+ auto_set_website_image = True
+ self.website_image = self.image
+
+ file = frappe.db.get_value("File", filters={
+ "file_url": self.website_image,
+ "attached_to_doctype": self.doctype,
+ "attached_to_name": self.name
+ }, fieldname=["name", "is_private"], as_dict=True)
+
+ if not file:
+ self.website_image = None
+ if not auto_set_website_image:
+ frappe.msgprint(_("Website Image {0} attached to Item {1} cannot be found").format(self.website_image, self.name))
+
+ elif file.is_private:
+ self.website_image = None
+ if not auto_set_website_image:
+ frappe.msgprint(_("Website Image should be a public file or website URL"))
+
def make_thumbnail(self):
"""Make a thumbnail of `website_image`"""
import requests.exceptions
@@ -383,7 +405,7 @@ class Item(WebsiteGenerator):
for d in self.get("reorder_levels"):
if d.warehouse_reorder_level and not d.warehouse_reorder_qty:
frappe.throw(_("Row #{0}: Please set reorder quantity").format(d.idx))
-
+
def validate_warehouse_for_reorder(self):
warehouse = []
From 13ec41abb27ce77e66c9c5d938de9d48ea1b3e44 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Thu, 10 Dec 2015 12:31:36 +0530
Subject: [PATCH 7/9] [enhancement] task status will be set to overdue when it
crosses expected end date
---
.../current/task_notification_change.md | 2 +
erpnext/hooks.py | 3 +-
erpnext/patches.txt | 1 +
erpnext/patches/v6_12/__init__.py | 0
erpnext/patches/v6_12/set_overdue_tasks.py | 7 +
erpnext/projects/doctype/task/task.js | 7 +
erpnext/projects/doctype/task/task.json | 230 ++++++++++--------
erpnext/projects/doctype/task/task.py | 6 +
erpnext/projects/doctype/task/task_list.js | 15 +-
erpnext/projects/doctype/task/test_task.py | 17 +-
erpnext/startup/notifications.py | 2 +-
11 files changed, 183 insertions(+), 107 deletions(-)
create mode 100644 erpnext/change_log/current/task_notification_change.md
create mode 100644 erpnext/patches/v6_12/__init__.py
create mode 100644 erpnext/patches/v6_12/set_overdue_tasks.py
diff --git a/erpnext/change_log/current/task_notification_change.md b/erpnext/change_log/current/task_notification_change.md
new file mode 100644
index 00000000000..b6060f0aea9
--- /dev/null
+++ b/erpnext/change_log/current/task_notification_change.md
@@ -0,0 +1,2 @@
+- Task status will be automatically set to "Overdue" when it crosses expected end date.
+- Task notification will only be for overdue tasks, not open tasks.
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index bed3a914c73..4d7eda5ab2c 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -125,7 +125,8 @@ scheduler_events = {
"erpnext.setup.doctype.email_digest.email_digest.send",
"erpnext.support.doctype.issue.issue.auto_close_tickets",
"erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year",
- "erpnext.hr.doctype.employee.employee.send_birthday_reminders"
+ "erpnext.hr.doctype.employee.employee.send_birthday_reminders",
+ "erpnext.projects.doctype.task.task.set_tasks_as_overdue"
]
}
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index ac5e5ca5eb2..612a44732ac 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -239,3 +239,4 @@ erpnext.patches.v6_10.email_digest_default_quote
erpnext.patches.v6_10.fix_billed_amount_in_drop_ship_po
erpnext.patches.v6_10.fix_delivery_status_of_drop_ship_item #2015-12-08
erpnext.patches.v5_8.tax_rule #2015-12-08
+erpnext.patches.v6_12.set_overdue_tasks
diff --git a/erpnext/patches/v6_12/__init__.py b/erpnext/patches/v6_12/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/patches/v6_12/set_overdue_tasks.py b/erpnext/patches/v6_12/set_overdue_tasks.py
new file mode 100644
index 00000000000..39d601aa004
--- /dev/null
+++ b/erpnext/patches/v6_12/set_overdue_tasks.py
@@ -0,0 +1,7 @@
+import frappe
+
+def execute():
+ frappe.reload_doctype("Task")
+
+ from erpnext.projects.doctype.task.task import set_tasks_as_overdue
+ set_tasks_as_overdue()
diff --git a/erpnext/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js
index 4e870fa59bf..755147c79fc 100644
--- a/erpnext/projects/doctype/task/task.js
+++ b/erpnext/projects/doctype/task/task.js
@@ -8,6 +8,13 @@ cur_frm.add_fetch("project", "company", "company");
frappe.ui.form.on("Task", {
refresh: function(frm) {
var doc = frm.doc;
+ if(doc.__islocal) {
+ if(!frm.doc.exp_end_date) {
+ frm.set_value("exp_end_date", frappe.datetime.add_days(new Date(), 7));
+ }
+ }
+
+
if(!doc.__islocal) {
if(frappe.model.can_read("Time Log")) {
frm.add_custom_button(__("Time Logs"), function() {
diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json
index 1dd2a5c4e49..0e7f4fcd358 100644
--- a/erpnext/projects/doctype/task/task.json
+++ b/erpnext/projects/doctype/task/task.json
@@ -26,6 +26,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -51,6 +52,7 @@
"options": "Project",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -73,6 +75,7 @@
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "50%",
"read_only": 0,
"report_hide": 0,
@@ -84,7 +87,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "status",
"fieldtype": "Select",
@@ -97,9 +100,10 @@
"no_copy": 1,
"oldfieldname": "status",
"oldfieldtype": "Select",
- "options": "Open\nWorking\nPending Review\nClosed\nCancelled",
+ "options": "Open\nWorking\nPending Review\nOverdue\nClosed\nCancelled",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -125,6 +129,7 @@
"options": "Low\nMedium\nHigh\nUrgent",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -132,102 +137,6 @@
"set_only_once": 0,
"unique": 0
},
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "Simple",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Details",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "description",
- "oldfieldtype": "Text Editor",
- "permlevel": 0,
- "print_hide": 0,
- "print_width": "300px",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "300px"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Depends On",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "depends_on",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "depends_on",
- "length": 0,
- "no_copy": 0,
- "options": "Task Depends On",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
{
"allow_on_submit": 0,
"bold": 0,
@@ -243,6 +152,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -267,6 +177,7 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -293,6 +204,7 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -315,6 +227,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -324,7 +237,7 @@
},
{
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"fieldname": "exp_end_date",
"fieldtype": "Date",
@@ -339,6 +252,7 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -346,6 +260,106 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Details",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "description",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+ "width": "300px"
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Depends On",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "depends_on",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "depends_on",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Task Depends On",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"bold": 0,
@@ -363,6 +377,7 @@
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"print_width": "50%",
"read_only": 0,
"report_hide": 0,
@@ -389,6 +404,7 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -415,6 +431,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -437,6 +454,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -461,6 +479,7 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -483,6 +502,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -508,6 +528,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -532,6 +553,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -554,6 +576,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -577,6 +600,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -599,6 +623,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -624,6 +649,7 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -649,6 +675,7 @@
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -670,6 +697,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -693,6 +721,7 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -711,7 +740,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 5,
- "modified": "2015-11-16 06:29:59.063379",
+ "menu_index": 0,
+ "modified": "2015-12-10 01:43:16.137084",
"modified_by": "Administrator",
"module": "Projects",
"name": "Task",
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index cd0aabec94e..15c98f4c401 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -144,3 +144,9 @@ def set_multiple_status(names, status):
task = frappe.get_doc("Task", name)
task.status = status
task.save()
+
+def set_tasks_as_overdue():
+ frappe.db.sql("""update tabTask set `status`='Overdue'
+ where exp_end_date is not null
+ and exp_end_date < CURDATE()
+ and `status` not in ('Closed', 'Cancelled')""")
diff --git a/erpnext/projects/doctype/task/task_list.js b/erpnext/projects/doctype/task/task_list.js
index 2a02fbb7453..48a46555e54 100644
--- a/erpnext/projects/doctype/task/task_list.js
+++ b/erpnext/projects/doctype/task/task_list.js
@@ -1,10 +1,6 @@
frappe.listview_settings['Task'] = {
add_fields: ["project", "status", "priority", "exp_end_date"],
onload: function(listview) {
- frappe.route_options = {
- "status": "Open"
- };
-
var method = "erpnext.projects.doctype.task.task.set_multiple_status";
listview.page.add_menu_item(__("Set as Open"), function() {
@@ -14,6 +10,17 @@ frappe.listview_settings['Task'] = {
listview.page.add_menu_item(__("Set as Closed"), function() {
listview.call_for_selected_items(method, {"status": "Closed"});
});
+ },
+ get_indicator: function(doc) {
+ var colors = {
+ "Open": "orange",
+ "Overdue": "red",
+ "Pending Review": "orange",
+ "Working": "orange",
+ "Closed": "green",
+ "Cancelled": "dark grey"
+ }
+ return [__(doc.status), colors[doc.status], "status,=," + doc.status];
}
};
diff --git a/erpnext/projects/doctype/task/test_task.py b/erpnext/projects/doctype/task/test_task.py
index fced0a45ed2..7007269e4e8 100644
--- a/erpnext/projects/doctype/task/test_task.py
+++ b/erpnext/projects/doctype/task/test_task.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
import unittest
-from frappe.utils import getdate
+from frappe.utils import getdate, nowdate, add_days
# test_records = frappe.get_test_records('Task')
@@ -177,3 +177,18 @@ class TestTask(unittest.TestCase):
todo = get_owner_and_status()
self.assertEquals(todo.owner, "test@example.com")
self.assertEquals(todo.status, "Closed")
+
+ def test_overdue(self):
+ task = frappe.get_doc({
+ "doctype":"Task",
+ "subject": "Testing Overdue",
+ "status": "Open",
+ "exp_end_date": add_days(nowdate(), -1)
+ })
+
+ task.insert()
+
+ from erpnext.projects.doctype.task.task import set_tasks_as_overdue
+ set_tasks_as_overdue()
+
+ self.assertEquals(frappe.db.get_value("Task", task.name, "status"), "Overdue")
diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py
index 4b5de233e5c..3acf63c5f07 100644
--- a/erpnext/startup/notifications.py
+++ b/erpnext/startup/notifications.py
@@ -8,7 +8,7 @@ def get_notification_config():
{
"Issue": {"status": "Open"},
"Warranty Claim": {"status": "Open"},
- "Task": {"status": "Open"},
+ "Task": {"status": "Overdue"},
"Project": {"status": "Open"},
"Lead": {"status": "Open"},
"Contact": {"status": "Open"},
From 360b057b0a34daa7e5cb1b5960161c8444bc17b4 Mon Sep 17 00:00:00 2001
From: Nabin Hait
Date: Thu, 10 Dec 2015 14:37:28 +0530
Subject: [PATCH 8/9] [chnage-log]
---
.../{current/task_notification_change.md => v6/v6_12_9.md} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename erpnext/change_log/{current/task_notification_change.md => v6/v6_12_9.md} (100%)
diff --git a/erpnext/change_log/current/task_notification_change.md b/erpnext/change_log/v6/v6_12_9.md
similarity index 100%
rename from erpnext/change_log/current/task_notification_change.md
rename to erpnext/change_log/v6/v6_12_9.md
From 9cca3494c0a2430f9f28c3080ab09d017c96f0da Mon Sep 17 00:00:00 2001
From: Nabin Hait
Date: Thu, 10 Dec 2015 15:11:02 +0600
Subject: [PATCH 9/9] bumped to version 6.12.9
---
erpnext/__version__.py | 2 +-
erpnext/hooks.py | 2 +-
setup.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index 723e7cecae1..9a1686af083 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
from __future__ import unicode_literals
-__version__ = '6.12.8'
+__version__ = '6.12.9'
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 4d7eda5ab2c..05e53c5677c 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = """ERP made simple"""
app_icon = "icon-th"
app_color = "#e74c3c"
-app_version = "6.12.8"
+app_version = "6.12.9"
app_email = "info@erpnext.com"
app_license = "GNU General Public License (v3)"
source_link = "https://github.com/frappe/erpnext"
diff --git a/setup.py b/setup.py
index ddc29f8ca6b..d654a2f7a5e 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
from pip.req import parse_requirements
-version = "6.12.8"
+version = "6.12.9"
requirements = parse_requirements("requirements.txt", session="")
setup(
| |