[item] patches
diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py
index f5ce9f7..fc09b59 100644
--- a/erpnext/config/selling.py
+++ b/erpnext/config/selling.py
@@ -8,21 +8,11 @@
"items": [
{
"type": "doctype",
- "name": "Lead",
- "description": _("Database of potential customers."),
- },
- {
- "type": "doctype",
"name": "Customer",
"description": _("Customer database."),
},
{
"type": "doctype",
- "name": "Opportunity",
- "description": _("Potential opportunities for selling."),
- },
- {
- "type": "doctype",
"name": "Quotation",
"description": _("Quotes to Leads or Customers."),
},
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index faeaf53..c3e5dfa 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -122,3 +122,4 @@
erpnext.patches.v5_0.stock_entry_update_value
erpnext.patches.v5_0.convert_stock_reconciliation
erpnext.patches.v5_0.update_projects
+erpnext.patches.v5_0.item_patches
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 820299e..9083ead 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -113,6 +113,17 @@
"read_only": 0
},
{
+ "default": "2099-12-31",
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "end_of_life",
+ "fieldtype": "Date",
+ "label": "End of Life",
+ "oldfieldname": "end_of_life",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
"fieldname": "column_break0",
"fieldtype": "Column Break",
"permlevel": 0,
@@ -321,16 +332,6 @@
},
{
"depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "fieldname": "end_of_life",
- "fieldtype": "Date",
- "label": "End of Life",
- "oldfieldname": "end_of_life",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
"description": "Net Weight of each Item",
"fieldname": "net_weight",
"fieldtype": "Float",
@@ -873,7 +874,7 @@
"icon": "icon-tag",
"idx": 1,
"max_attachments": 1,
- "modified": "2015-02-21 06:27:23.368218",
+ "modified": "2015-02-22 23:59:37.956424",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
diff --git a/erpnext/stock/doctype/item/item_list.js b/erpnext/stock/doctype/item/item_list.js
index 0436721..8e96ce5 100644
--- a/erpnext/stock/doctype/item/item_list.js
+++ b/erpnext/stock/doctype/item/item_list.js
@@ -1,10 +1,15 @@
frappe.listview_settings['Item'] = {
- add_fields: ["item_name", "stock_uom", "item_group", "image", "variant_of", "has_variants"],
+ add_fields: ["item_name", "stock_uom", "item_group", "image", "variant_of",
+ "has_variants", "end_of_life", "is_sales_item"],
get_indicator: function(doc) {
- if(doc.has_variants) {
+ if(doc.end_of_life < frappe.datetime.get_today()) {
+ return [__("Expired"), "grey", "end_of_life,<,Today"]
+ } else if(doc.has_variants) {
return [__("Template"), "blue", "has_variant,=,1"]
} else if(doc.variant_of) {
return [__("Variant"), "green", "variant_of,=," + doc.variant_of]
+ } else {
+ return [__("Active"), "blue", "end_of_life,>=,Today"]
}
}
};