mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
setting list_views
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-22 15:11:38",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-01-23 17:00:25",
|
||||
"modified": "2013-01-29 17:32:53",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -57,6 +57,7 @@
|
||||
"fieldname": "item",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Item",
|
||||
"oldfieldname": "item",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -76,6 +77,7 @@
|
||||
"fieldname": "is_active",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Is Active",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "is_active",
|
||||
@@ -87,6 +89,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "is_default",
|
||||
"fieldtype": "Check",
|
||||
"in_list_view": 1,
|
||||
"label": "Is Default",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "is_default",
|
||||
@@ -151,6 +154,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "total_cost",
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
"label": "Total Cost",
|
||||
"read_only": 1
|
||||
},
|
||||
@@ -217,6 +221,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"in_list_view": 1,
|
||||
"label": "Item Desription",
|
||||
"read_only": 1
|
||||
},
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
// render
|
||||
wn.doclistviews['BOM'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d);
|
||||
this.fields = this.fields.concat([
|
||||
'`tabBOM`.item',
|
||||
'`tabBOM`.uom',
|
||||
'IFNULL(`tabBOM`.quantity, 0) as quantity',
|
||||
'`tabBOM`.is_active',
|
||||
'`tabBOM`.costing_date',
|
||||
'`tabBOM`.total_cost',
|
||||
'`tabBOM`.description',
|
||||
]);
|
||||
this.stats = this.stats.concat(['company']);
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
data.costing_date = wn.datetime.str_to_user(data.costing_date);
|
||||
data.description = (data.is_active ? '' : '[Inactive] ') + data.description;
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content: 'check'},
|
||||
{width: '3%', content: 'docstatus'},
|
||||
{width: '15%', content: 'name'},
|
||||
{width: '15%', content: 'item'},
|
||||
{width: '23%', content: 'description+tags'},
|
||||
{
|
||||
width: '12%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(data.quantity + ' ' + data.uom)
|
||||
},
|
||||
css: {'text-align':'right'},
|
||||
},
|
||||
{
|
||||
width: '20%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(format_currency(data.total_cost));
|
||||
},
|
||||
css: {'text-align': 'right'},
|
||||
},
|
||||
{width: '12%', content:'costing_date', css: {
|
||||
'text-align': 'right', 'color':'#777'
|
||||
}},
|
||||
]
|
||||
});
|
||||
Reference in New Issue
Block a user