setting list_views

This commit is contained in:
Rushabh Mehta
2013-01-29 17:53:29 +05:30
parent 6abb2e67e9
commit 08da1a0a3d
105 changed files with 575 additions and 1736 deletions

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:17",
"docstatus": 0,
"modified": "2013-01-23 17:11:21",
"modified": "2013-01-29 17:01:19",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -215,11 +215,12 @@
"doctype": "DocField",
"fieldname": "project_value",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Project Value",
"no_copy": 0,
"oldfieldname": "project_value",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"options": "Company:company:default_currency",
"reqd": 0,
"search_index": 0
},
@@ -231,7 +232,7 @@
"no_copy": 0,
"oldfieldname": "est_material_cost",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"options": "Company:company:default_currency",
"search_index": 0
},
{
@@ -250,7 +251,7 @@
"no_copy": 0,
"oldfieldname": "gross_margin_value",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"options": "Company:company:default_currency",
"reqd": 0,
"search_index": 0
},
@@ -262,7 +263,7 @@
"no_copy": 0,
"oldfieldname": "per_gross_margin",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()",
"options": "Company:company:default_currency",
"reqd": 0,
"search_index": 0
},

View File

@@ -1,52 +0,0 @@
// render
wn.doclistviews['Project'] = wn.views.ListView.extend({
init: function(d) {
this._super(d);
this.fields = this.fields.concat([
'`tabProject`.project_name',
'`tabProject`.status',
'`tabProject`.is_active',
'`tabProject`.priority',
'IFNULL(`tabProject`.project_value, 0) as project_value',
'IFNULL(`tabProject`.per_gross_margin, 0) as per_gross_margin',
'`tabProject`.creation',
]);
//this.stats = this.stats.concat(['company']);
},
prepare_data: function(data) {
this._super(data);
data.completion_date = wn.datetime.str_to_user(data.completion_date);
},
columns: [
{width: '3%', content: 'check'},
{width: '3%', content: 'docstatus'},
{width: '15%', content: 'name'},
{width: '22%', content: 'project_name+tags'},
{
width: '20%',
content: function(parent, data) {
$(parent).html(data.status + " [" + data.priority + "] "
+ (data.is_active=='No'?" [Inactive]":""));
},
},
{
width: '15%',
content: function(parent, data) {
$(parent).html(format_currency(data.project_value));
},
css: {'text-align': 'right'},
},
{
width: '10%',
content: function(parent, data) {
$(parent).html(format_number(data.per_gross_margin) + " %");
},
css: {'text-align': 'right'},
},
{
width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}
},
]
});

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:17",
"docstatus": 0,
"modified": "2013-01-23 17:11:21",
"modified": "2013-01-29 16:27:52",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -57,6 +57,7 @@
"fieldname": "subject",
"fieldtype": "Data",
"in_filter": 1,
"in_list_view": 1,
"label": "Subject",
"oldfieldname": "subject",
"oldfieldtype": "Data",
@@ -94,6 +95,7 @@
"doctype": "DocField",
"fieldname": "project",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Project",
"oldfieldname": "project",
"oldfieldtype": "Link",
@@ -103,6 +105,7 @@
"doctype": "DocField",
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"no_copy": 1,
"oldfieldname": "status",
@@ -114,6 +117,7 @@
"fieldname": "priority",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"label": "Priority",
"oldfieldname": "priority",
"oldfieldtype": "Select",
@@ -171,7 +175,7 @@
"label": "Allocated Budget",
"oldfieldname": "allocated_budget",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()"
"options": "Company:company:default_currency"
},
{
"doctype": "DocField",
@@ -205,7 +209,7 @@
"label": "Actual Budget",
"oldfieldname": "actual_budget",
"oldfieldtype": "Currency",
"options": "eval:erpnext.get_currency()"
"options": "Company:company:default_currency"
},
{
"doctype": "DocField",

View File

@@ -1,50 +0,0 @@
// render
wn.doclistviews['Task'] = wn.views.ListView.extend({
init: function(d) {
this._super(d);
this.fields = this.fields.concat([
'`tabTask`.subject',
'`tabTask`.project',
'`tabTask`.status',
'`tabTask`.opening_date',
'`tabTask`.priority',
]);
this.stats = this.stats.concat(['status']);
},
label_style: {
"status": {
"Open": "danger",
"Closed": "success",
"Hold": "info",
"Waiting for Customer": "info"
}
},
prepare_data: function(data) {
this._super(data);
data.label_style = this.label_style.status[data.status];
if(data.label_style=="danger")
data.label_style = "important"
data.status_html = repl('<span class="label \
label-%(label_style)s">%(status)s</span>', data);
// escape double quotes
data.description = cstr(data.subject)
+ " | " + cstr(data.description);
data.description = data.description.replace(/"/gi, '\"')
.replace(/</gi, '&lt;').replace(/>/gi, '&gt;');
},
columns: [
{width: '3%', content: 'check'},
{width: '5%', content: 'avatar_modified'},
{width: '20%', content:'name'},
{width: '10%', content:'status_html'},
{width: '40%', content: 'subject+tags'},
{width: '20%', content: 'project'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:17",
"docstatus": 0,
"modified": "2013-01-22 14:57:26",
"modified": "2013-01-29 14:36:53",
"modified_by": "Administrator",
"owner": "ashwini@webnotestech.com"
},
@@ -53,6 +53,7 @@
"fieldname": "status",
"fieldtype": "Select",
"in_filter": 0,
"in_list_view": 1,
"label": "Status",
"oldfieldname": "status",
"oldfieldtype": "Select",
@@ -116,6 +117,7 @@
"doctype": "DocField",
"fieldname": "notes",
"fieldtype": "Text",
"in_list_view": 1,
"label": "Notes"
},
{

View File

@@ -1,35 +0,0 @@
// render
wn.doclistviews['Timesheet'] = wn.views.ListView.extend({
init: function(d) {
this._super(d);
this.fields = this.fields.concat([
'`tabTimesheet`.status',
'`tabTimesheet`.timesheet_date',
'`tabTimesheet`.owner',
'`tabTimesheet`.notes',
]);
},
prepare_data: function(data) {
this._super(data);
data.timesheet_date = wn.datetime.str_to_user(data.timesheet_date);
if(data.notes && data.notes.length > 50) {
data.notes = '<span title="'+data.notes+'">' +
data.notes.substr(0,50) + '...</span>';
}
},
columns: [
{width: '3%', content: 'check'},
{width: '5%', content: 'avatar'},
{width: '3%', content: 'docstatus'},
{width: '18%', content: 'name'},
{width: '12%', content: 'status'},
{width: '27%', content: 'notes+tags', css: {'color': '#777'}},
{width: '20%', content: 'owner'},
{width: '12%', content:'timesheet_date', css: {
'text-align': 'right', 'color':'#777'
}},
]
});