diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py index f5ce9f7c914..fc09b599a23 100644 --- a/erpnext/config/selling.py +++ b/erpnext/config/selling.py @@ -6,21 +6,11 @@ def get_data(): "label": _("Documents"), "icon": "icon-star", "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", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index faeaf531364..c3e5dfa9a1b 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -122,3 +122,4 @@ erpnext.patches.v5_0.update_material_transferred_for_qty 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 820299ec240..9083ead8731 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -112,6 +112,17 @@ "permlevel": 0, "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", @@ -319,16 +330,6 @@ "permlevel": 0, "read_only": 0 }, - { - "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", @@ -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 04367218dc6..8e96ce57658 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"] } } };