[item] patches

This commit is contained in:
Rushabh Mehta 2015-02-23 11:31:35 +05:30
parent d54031f3b5
commit d06c1188a0
4 changed files with 20 additions and 23 deletions

View File

@ -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",

View File

@ -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

View File

@ -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",

View File

@ -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"]
}
}
};