From 06fcfdfcdebed1cd3bca1de72642f50cc612f519 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 22 Mar 2012 11:01:38 +0530 Subject: [PATCH 1/5] assign to - allow comments --- erpnext/utilities/page/todo/todo.css | 4 ++-- erpnext/utilities/page/todo/todo.js | 7 ++++++- js/all-app.js | 2 +- version.num | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/erpnext/utilities/page/todo/todo.css b/erpnext/utilities/page/todo/todo.css index 4ac49d621c..01a4d243a9 100644 --- a/erpnext/utilities/page/todo/todo.css +++ b/erpnext/utilities/page/todo/todo.css @@ -20,7 +20,7 @@ .todoitem .ref_link { float: left; - margin-left: 14px; + margin-left: 10px; display: inline-block; line-height: 18px; } @@ -28,4 +28,4 @@ .todoitem .description { cursor: pointer; float: left; -} \ No newline at end of file +} diff --git a/erpnext/utilities/page/todo/todo.js b/erpnext/utilities/page/todo/todo.js index 0f1aa5c65d..d9fd7a7db4 100644 --- a/erpnext/utilities/page/todo/todo.js +++ b/erpnext/utilities/page/todo/todo.js @@ -46,6 +46,11 @@ erpnext.todo.ToDoItem = Class.extend({ } todo.labelclass = label_map[todo.priority]; todo.userdate = dateutil.str_to_user(todo.date) || ''; + if(todo.assigned_by) { + todo.fullname = repl("[By %(fullname)s] ", { + fullname: wn.boot.user_info[todo.assigned_by].fullname + }) + } if(todo.reference_name && todo.reference_type) { todo.link = repl('\ %(reference_type)s: %(reference_name)s', todo); @@ -59,7 +64,7 @@ erpnext.todo.ToDoItem = Class.extend({ \ %(priority)s\ %(userdate)s\ - %(description)s\ + %(fullname)s%(description)s\ →  \ %(link)s\ ×\ diff --git a/js/all-app.js b/js/all-app.js index abb3c085aa..6987da6e57 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -2170,7 +2170,7 @@ wn.widgets.form.sidebar.AssignTo=Class.extend({init:function(parent,sidebar,doct this.refresh();},refresh:function(){var me=this;$c('webnotes.widgets.form.assign_to.get',{doctype:me.doctype,name:me.name},function(r,rt){me.render(r.message)})},render:function(d){var me=this;$(this.body).empty();if(this.dialog){this.dialog.hide();} for(var i=0;i%(owner)s \ ×',d[i]))} -$(this.body).find('a.close').click(function(){$c('webnotes.widgets.form.assign_to.remove',{doctype:me.doctype,name:me.name,assign_to:$(this).attr('data-owner')},function(r,rt){me.render(r.message);});return false;});},add:function(){var me=this;if(!me.dialog){me.dialog=new wn.widgets.Dialog({title:'Add to To Do',width:350,fields:[{fieldtype:'Link',fieldname:'assign_to',options:'Profile',label:'Assign To',description:'Add to To Do List of',reqd:true},{fieldtype:'Data',fieldname:'description',label:'Comment','default':'Assigned by '+user},{fieldtype:'Date',fieldname:'date',label:'Complete By'},{fieldtype:'Select',fieldname:'priority',label:'Priority',options:'Low\nMedium\nHigh','default':'Medium'},{fieldtype:'Check',fieldname:'notify',label:'Notify By Email'},{fieldtype:'Button',label:'Add',fieldname:'add_btn'}]});me.dialog.fields_dict.add_btn.input.onclick=function(){var assign_to=me.dialog.fields_dict.assign_to.get_value();if(assign_to){$c('webnotes.widgets.form.assign_to.add',{doctype:me.doctype,name:me.name,assign_to:assign_to,description:me.dialog.fields_dict.description.get_value(),priority:me.dialog.fields_dict.priority.get_value(),date:me.dialog.fields_dict.date.get_value(),notify:me.dialog.fields_dict.notify.get_value()},function(r,rt){me.render(r.message);});}}} +$(this.body).find('a.close').click(function(){$c('webnotes.widgets.form.assign_to.remove',{doctype:me.doctype,name:me.name,assign_to:$(this).attr('data-owner')},function(r,rt){me.render(r.message);});return false;});},add:function(){var me=this;if(!me.dialog){me.dialog=new wn.widgets.Dialog({title:'Add to To Do',width:350,fields:[{fieldtype:'Link',fieldname:'assign_to',options:'Profile',label:'Assign To',description:'Add to To Do List of',reqd:true},{fieldtype:'Data',fieldname:'description',label:'Comment'},{fieldtype:'Date',fieldname:'date',label:'Complete By'},{fieldtype:'Select',fieldname:'priority',label:'Priority',options:'Low\nMedium\nHigh','default':'Medium'},{fieldtype:'Check',fieldname:'notify',label:'Notify By Email'},{fieldtype:'Button',label:'Add',fieldname:'add_btn'}]});me.dialog.fields_dict.add_btn.input.onclick=function(){var assign_to=me.dialog.fields_dict.assign_to.get_value();if(assign_to){$c('webnotes.widgets.form.assign_to.add',{doctype:me.doctype,name:me.name,assign_to:assign_to,description:me.dialog.fields_dict.description.get_value(),priority:me.dialog.fields_dict.priority.get_value(),date:me.dialog.fields_dict.date.get_value(),notify:me.dialog.fields_dict.notify.get_value()},function(r,rt){me.render(r.message);});}}} me.dialog.clear();me.dialog.show();}}); /* * lib/js/legacy/app.js diff --git a/version.num b/version.num index f08bce7b1c..3f986b9191 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -841 \ No newline at end of file +842 \ No newline at end of file From 98f847c01f03b25fbd4bce636639036295e8fc72 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 22 Mar 2012 11:18:28 +0530 Subject: [PATCH 2/5] fix in todo --- erpnext/utilities/page/todo/todo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/utilities/page/todo/todo.js b/erpnext/utilities/page/todo/todo.js index d9fd7a7db4..dcdf50aa9d 100644 --- a/erpnext/utilities/page/todo/todo.js +++ b/erpnext/utilities/page/todo/todo.js @@ -50,7 +50,7 @@ erpnext.todo.ToDoItem = Class.extend({ todo.fullname = repl("[By %(fullname)s] ", { fullname: wn.boot.user_info[todo.assigned_by].fullname }) - } + } else { todo.fullname = ''; } if(todo.reference_name && todo.reference_type) { todo.link = repl('\ %(reference_type)s: %(reference_name)s', todo); From 358304d21657537a4e969ac05cb0face0a95d699 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 23 Mar 2012 11:12:03 +0530 Subject: [PATCH 3/5] fix in sales common regarding date formatting --- erpnext/selling/doctype/sales_common/sales_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_common/sales_common.py b/erpnext/selling/doctype/sales_common/sales_common.py index 63f53eab7b..5c1a8e451f 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.py +++ b/erpnext/selling/doctype/sales_common/sales_common.py @@ -515,7 +515,7 @@ class DocType(TransactionBase): dt = webnotes.conn.sql("select posting_date from `tab%s` where name = '%s'" % (d.prevdoc_doctype, d.prevdoc_docname)) else: dt = webnotes.conn.sql("select transaction_date from `tab%s` where name = '%s'" % (d.prevdoc_doctype, d.prevdoc_docname)) - d.prevdoc_date = dt and dt[0][0].strftime('%Y-%m-%d') or '' + d.prevdoc_date = (dt and dt[0][0]) and dt[0][0].strftime('%Y-%m-%d') or '' def update_prevdoc_detail(self, is_submit, obj): StatusUpdater(obj, is_submit).update() From f23d18316ac093cbdadccd45ead8b6d391b51ee9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 26 Mar 2012 10:53:45 +0530 Subject: [PATCH 4/5] modified item code get_query in purchase cycle --- erpnext/buying/doctype/purchase_common/purchase_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index f0f24a0eca..f258f110ed 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -162,7 +162,7 @@ cur_frm.cscript.conversion_rate = function(doc,cdt,cdn) { //==================== Item Code Get Query ======================================================= // Only Is Purchase Item = 'Yes' and Items not moved to trash are allowed. cur_frm.fields_dict[fname].grid.get_field("item_code").get_query = function(doc, cdt, cdn) { - return 'SELECT tabItem.name, tabItem.description FROM tabItem WHERE (ifnull(tabItem.is_purchase_item, "No")="Yes" or ifnull(tabItem.is_sub_contracted_item, "No")="Yes") AND (IFNULL(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` ="0000-00-00" OR `tabItem`.`end_of_life` > NOW()) AND tabItem.%(key)s LIKE "%s" LIMIT 50' + return 'SELECT tabItem.name, tabItem.description FROM tabItem WHERE (ifnull(tabItem.is_purchase_item, "No")="Yes" or ifnull(tabItem.is_sub_contracted_item, "No")="Yes") AND (IFNULL(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` ="0000-00-00" OR `tabItem`.`end_of_life` > NOW()) AND tabItem.docstatus != 2 AND tabItem.%(key)s LIKE "%s" LIMIT 50' } //==================== Get Item Code Details ===================================================== From 964dee9f18f6be0b2d58ae5391eedd20805f90d3 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 26 Mar 2012 10:54:05 +0530 Subject: [PATCH 5/5] fix in stock reconciliation --- .../stock/doctype/stock_reconciliation/stock_reconciliation.py | 3 +-- erpnext/stock/doctype/warehouse/warehouse.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 8ea8273e95..08ef1bcac9 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -59,8 +59,7 @@ class DocType: self.validate_item(s[0], count) self.validate_warehouse(s[1], count) - # encode as ascii - self.data.append([d.encode("ascii") for d in s]) + self.data.append(s) count += 1 if not self.validated: diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index 8b08fab098..f04f4eec4c 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -39,7 +39,8 @@ class DocType: self.doclist = doclist def get_bin(self, item_code): - bin = sql("select name from tabBin where item_code = '%s' and warehouse = '%s'" % (item_code, self.doc.name)) + bin = sql("select name from tabBin where item_code = %s and \ + warehouse = %s", (item_code, self.doc.name)) bin = bin and bin[0][0] or '' if not bin: if not self.doc.warehouse_type :