mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-30 12:08:26 +00:00
setting list_views
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:30",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 14:55:59",
|
||||
"modified": "2013-01-28 17:54:09",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "harshada@webnotestech.com"
|
||||
},
|
||||
@@ -57,6 +57,7 @@
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Status",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "status",
|
||||
@@ -89,6 +90,7 @@
|
||||
"fieldname": "customer",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Customer",
|
||||
"oldfieldname": "customer",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -136,6 +138,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "serial_no",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 0,
|
||||
"label": "Serial No",
|
||||
"options": "Serial No"
|
||||
},
|
||||
@@ -144,6 +147,7 @@
|
||||
"fieldname": "item_code",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Item Code",
|
||||
"oldfieldname": "item_code",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -185,6 +189,7 @@
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Warranty / AMC Status",
|
||||
"options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC"
|
||||
},
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
// render
|
||||
wn.doclistviews['Customer Issue'] = wn.views.ListView.extend({
|
||||
me: this,
|
||||
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabCustomer Issue`.customer",
|
||||
"`tabCustomer Issue`.serial_no",
|
||||
"`tabCustomer Issue`.item_name",
|
||||
"`tabCustomer Issue`.complaint",
|
||||
"`tabCustomer Issue`.status",
|
||||
]);
|
||||
this.stats = this.stats.concat(['status', 'company']);
|
||||
//this.show_hide_check_column();
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
if(data.status=='Open') {
|
||||
data.label_type = 'important';
|
||||
} else if(data.status=='Closed') {
|
||||
data.label_type = 'success';
|
||||
} else if(data.status=='Cancelled') {
|
||||
data.label_type = 'info';
|
||||
} else if(data.status=='Work In Progress') {
|
||||
data.label_type = 'info';
|
||||
data.status = 'WIP';
|
||||
}
|
||||
|
||||
data.status_html = repl(
|
||||
'<span class="label label-%(label_type)s">%(status)s</span>', data);
|
||||
var a = $(data.status_html).click(function() {
|
||||
me.set_filter('status', $(this).text());
|
||||
});
|
||||
|
||||
var concat_list = [data.customer];
|
||||
data.serial_no && concat_list.push(data.serial_no);
|
||||
data.complaint && concat_list.push(data.complaint);
|
||||
data.complaint = concat_list.join(" | ");
|
||||
|
||||
// description
|
||||
if(data.complaint && data.complaint.length > 50) {
|
||||
data.complaint = '<span title="'+data.complaint+'">' +
|
||||
data.complaint.substr(0,50) + '...</span>';
|
||||
}
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content: 'check'},
|
||||
{width: '5%', content: 'avatar'},
|
||||
{width: '3%', content: 'docstatus'},
|
||||
{width: '20%', content: 'name'},
|
||||
{width: '10%', content: 'status_html'},
|
||||
{width: '47%', content: 'complaint+tags', css: {color:'#777'}},
|
||||
{width: '12%', content: 'modified',
|
||||
css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
|
||||
});
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:30",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 14:56:04",
|
||||
"modified": "2013-01-28 17:35:45",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -60,6 +60,7 @@
|
||||
"fieldname": "customer",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Customer",
|
||||
"oldfieldname": "customer",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -89,7 +90,8 @@
|
||||
"fieldname": "customer_name",
|
||||
"fieldtype": "Data",
|
||||
"in_filter": 1,
|
||||
"label": "Name",
|
||||
"in_list_view": 1,
|
||||
"label": "Customer Name",
|
||||
"oldfieldname": "customer_name",
|
||||
"oldfieldtype": "Data",
|
||||
"read_only": 1,
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
// render
|
||||
wn.doclistviews['Maintenance Schedule'] = wn.views.ListView.extend({
|
||||
me: this,
|
||||
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabMaintenance Schedule`.customer",
|
||||
]);
|
||||
this.stats = this.stats.concat(['company']);
|
||||
//this.show_hide_check_column();
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content: 'check'},
|
||||
{width: '5%', content: 'avatar'},
|
||||
{width: '3%', content: 'docstatus'},
|
||||
{width: '20%', content: 'name'},
|
||||
{width: '55%', content: 'customer+tags'},
|
||||
{width: '14%', content: 'modified',
|
||||
css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
|
||||
});
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:31",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-22 14:56:04",
|
||||
"modified": "2013-01-28 17:31:01",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "ashwini@webnotestech.com"
|
||||
},
|
||||
@@ -73,6 +73,7 @@
|
||||
"fieldname": "customer_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Customer Name",
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -147,6 +148,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "completion_status",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Completion Status",
|
||||
"oldfieldname": "completion_status",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -159,6 +161,7 @@
|
||||
"fieldname": "maintenance_type",
|
||||
"fieldtype": "Select",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Maintenance Type",
|
||||
"oldfieldname": "maintenance_type",
|
||||
"oldfieldtype": "Select",
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
// render
|
||||
wn.doclistviews['Maintenance Visit'] = wn.views.ListView.extend({
|
||||
me: this,
|
||||
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabMaintenance Visit`.customer_name",
|
||||
"`tabMaintenance Visit`.mntc_date",
|
||||
"`tabMaintenance Visit`.mntc_time",
|
||||
"`tabMaintenance Visit`.maintenance_type",
|
||||
"`tabMaintenance Visit`.completion_status",
|
||||
|
||||
]);
|
||||
this.stats = this.stats.concat(['completion_status', 'company']);
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
data.mntc_date = wn.datetime.str_to_user(data.mntc_date);
|
||||
data.date_time = "on " + data.mntc_date + " at " + data.mntc_time;
|
||||
data.customer_name = data.customer_name + " " + data.date_time;
|
||||
data.completion_status = data.completion_status +
|
||||
(data.maintenance_type ? " [" + data.maintenance_type + "]": "");
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content: 'check'},
|
||||
{width: '5%', content: 'avatar'},
|
||||
{width: '3%', content: 'docstatus'},
|
||||
{width: '15%', content: 'name'},
|
||||
{width: '40%', content: 'customer_name+tags'},
|
||||
{width: '20%', content: 'completion_status'},
|
||||
{width: '14%', content: 'modified',
|
||||
css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user