From 56f785ac804db45f4fbb9bb9e8226f4df112cc82 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 17 Sep 2012 10:04:16 +0530 Subject: [PATCH] updates to general ledger, todo --- js/wn/views/grid_report.js | 44 ++++++++++++++++++++++----- py/webnotes/widgets/form/assign_to.py | 6 ++-- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/js/wn/views/grid_report.js b/js/wn/views/grid_report.js index 95c9a1e2e5..175264eb41 100644 --- a/js/wn/views/grid_report.js +++ b/js/wn/views/grid_report.js @@ -152,10 +152,18 @@ wn.views.GridReport = Class.extend({ } else if(v.fieldtype=='Data') { input = me.appframe.add_data(v.label); } - if(v.cssClass) { - input && input.addClass(v.cssClass); + + if(input) { + input && (input.get(0).opts = v); + if(v.cssClass) { + input.addClass(v.cssClass); + } + input.keypress(function(e) { + if(e.which==13) { + me.refresh(); + } + }) } - input && (input.get(0).opts = v); me.filter_inputs[v.fieldname] = input; }); }, @@ -227,9 +235,14 @@ wn.views.GridReport = Class.extend({ for (var i=0, len=this.dataView.getLength(); i" + fmt_money(value) + ""; + return repl('
%(value)s
', { + _style: dataContext._style || "", + value: fmt_money(value) + }); }, text_formatter: function(row, cell, value, columnDef, dataContext) { - return "" + value + ""; + return repl('%(value)s', { + _style: dataContext._style || "", + esc_value: cstr(value).replace(/"/g, '\"'), + value: cstr(value) + }); }, apply_link_formatters: function() { var me = this; @@ -291,6 +311,14 @@ wn.views.GridReport = Class.extend({ // added link and open button to links // link_formatter must have // filter_input, open_btn (true / false), doctype (will be eval'd) + if(!value) return ""; + + if(dataContext._show) { + return repl('%(value)s', { + _style: dataContext._style || "", + value: value + }); + } // make link to add a filter var link_formatter = wn.cur_grid_report.columns[cell].link_formatter; diff --git a/py/webnotes/widgets/form/assign_to.py b/py/webnotes/widgets/form/assign_to.py index 3d57f97106..143bd63b79 100644 --- a/py/webnotes/widgets/form/assign_to.py +++ b/py/webnotes/widgets/form/assign_to.py @@ -98,11 +98,11 @@ def notify_assignment(assigned_by, owner, doc_type, doc_name, action='CLOSE', no """ Notify assignee that there is a change in assignment """ - if assigned_by==webnotes.session['user']: - return - if not (assigned_by and owner and doc_type and doc_name): return + if assigned_by==owner: + return + from webnotes.boot import get_fullnames user_info = get_fullnames()