list in listview and sales order fix

This commit is contained in:
Rushabh Mehta 2012-05-03 10:20:38 +05:30
parent a01e2cb2fb
commit acd0769098
5 changed files with 26 additions and 5 deletions

View File

@ -9,8 +9,6 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({
"`tabSales Invoice`.currency",
"ifnull(`tabSales Invoice`.grand_total_export,0) as grand_total_export"
]);
this.stats = this.stats.concat(['company']);
},
prepare_data: function(data) {
this._super(data);

View File

@ -0,0 +1,18 @@
// render
wn.doclistviews['Delivery Note'] = wn.views.ListView.extend({
init: function(d) {
this._super(d);
this.fields = this.fields.concat([
"`tabDelivery Note`.customer_name",
"`tabDelivery Note`.sales_order_no"
]);
},
columns: [
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '50%', content:'tags+customer_name', css: {color:'#aaa'}},
{width: '15%', content:'sales_order_no', type:'link', doctype:'Sales Order'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});

View File

@ -84,12 +84,13 @@ KBQuestionView = function(w, qid, qtext) {
// text area + add button
this.make_answer_box = function() {
$ds(w.add_answer_area);
$a(w.add_answer_area, 'h3', '', {}, 'Add Your Answer')
$(w.add_answer_area, '<h3>Add your Answer</h3>\
<div class="help">In markdown format</div>');
this.input = $a(w.add_answer_area, 'textarea');
wn.tinymce.add_simple(this.input);
//wn.tinymce.add_simple(this.input);
this.btn = $btn($a(w.add_answer_area, 'div'), 'Post', function() {
var v = wn.tinymce.get_value(me.input);
var v = $(me.input).val();
if(!v) { msgprint('Write something!'); return; }
me.btn.set_working();
$c_page('utilities', 'question_view', 'add_answer', {qid: qid, answer:v},

View File

@ -448,6 +448,8 @@ $(parent).append(repl('<span class="bar-outer" style="width: 30px; float: right"
<span class="bar-inner %(fully_delivered)s" \
style="width: %(percent)s%;"></span>\
</span>',args));}
else if(opts.type=='link'&&opts.doctype){$(parent).append(repl('<a href="#!Form/'+opts.doctype+'/'
+data[opts.content]+'">'+data[opts.content]+'</a>',data));}
else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:function(row,data){var me=this;this.prepare_data(data);rowhtml='';$.each(this.columns,function(i,v){rowhtml+=repl('<td style="width: %(width)s"></td>',v);});var tr=$(row).html('<table><tbody><tr>'+rowhtml+'</tr></tbody></table>').find('tr').get(0);$.each(this.columns,function(i,v){me.render_column(data,tr.cells[i],v);});},prepare_data:function(data){data.fullname=wn.user_info(data.owner).fullname;data.avatar=wn.user_info(data.owner).image;data.when=dateutil.str_to_user(data.modified).split(' ')[0];var diff=dateutil.get_diff(dateutil.get_today(),data.modified.split(' ')[0]);if(diff==0){data.when='Today'}
if(diff==1){data.when='Yesterday'}
if(diff==2){data.when='2 days ago'}

View File

@ -335,6 +335,8 @@ $(parent).append(repl('<span class="bar-outer" style="width: 30px; float: right"
<span class="bar-inner %(fully_delivered)s" \
style="width: %(percent)s%;"></span>\
</span>',args));}
else if(opts.type=='link'&&opts.doctype){$(parent).append(repl('<a href="#!Form/'+opts.doctype+'/'
+data[opts.content]+'">'+data[opts.content]+'</a>',data));}
else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:function(row,data){var me=this;this.prepare_data(data);rowhtml='';$.each(this.columns,function(i,v){rowhtml+=repl('<td style="width: %(width)s"></td>',v);});var tr=$(row).html('<table><tbody><tr>'+rowhtml+'</tr></tbody></table>').find('tr').get(0);$.each(this.columns,function(i,v){me.render_column(data,tr.cells[i],v);});},prepare_data:function(data){data.fullname=wn.user_info(data.owner).fullname;data.avatar=wn.user_info(data.owner).image;data.when=dateutil.str_to_user(data.modified).split(' ')[0];var diff=dateutil.get_diff(dateutil.get_today(),data.modified.split(' ')[0]);if(diff==0){data.when='Today'}
if(diff==1){data.when='Yesterday'}
if(diff==2){data.when='2 days ago'}