From 0fb4eeb5bbb97589613c079e03665bd2d9e68ed0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 4 May 2012 11:46:07 +0530 Subject: [PATCH 1/9] cancellation issue fixed in stock reco --- .../stock_reconciliation/stock_reconciliation.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 86cb099f92..e82a0d94f5 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -47,13 +47,13 @@ class DocType: return content - def convert_into_list(self, data): + def convert_into_list(self, data, submit = 1): """Convert csv data into list""" - count = 1 + count = 2 for s in data: if s[0].strip() != 'Item Code': # remove the labels # validate - if len(s) != 4: + if (submit and len(s) != 4) or (not submit and len(s) != 6): msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1) self.validated = 0 self.validate_item(s[0], count) @@ -66,17 +66,16 @@ class DocType: raise Exception - def get_reconciliation_data(self,submit = 0): + def get_reconciliation_data(self,submit = 1): """Read and validate csv data""" import csv data = csv.reader(self.get_csv_file_data().splitlines()) - self.convert_into_list(data) + self.convert_into_list(data, submit) def validate_item(self, item, count): """ Validate item exists and non-serialized""" - det = sql("select item_code, has_serial_no from `tabItem` \ - where name = %s", cstr(item), as_dict = 1) + det = sql("select item_code, has_serial_no from `tabItem` where name = %s", cstr(item), as_dict = 1) if not det: msgprint("Item: " + cstr(item) + " mentioned at Row No. " + cstr(count) + "does not exist in the system") self.validated = 0 @@ -199,5 +198,5 @@ class DocType: def on_cancel(self): - self.validate() + self.get_reconciliation_data(submit = 0) self.do_stock_reco(is_submit = -1) From 978a1e0e46e9088e8cb63dc9361acdb17fff1116 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 4 May 2012 11:57:55 +0530 Subject: [PATCH 2/9] field rearranged in sales invoice --- .../doctype/sales_invoice/sales_invoice.txt | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt index f66f877272..5ec5552fe4 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt @@ -5,7 +5,7 @@ { 'creation': '2012-04-13 11:56:18', 'docstatus': 0, - 'modified': '2012-05-02 09:57:50', + 'modified': '2012-05-04 11:56:59', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -296,19 +296,6 @@ 'search_index': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'posting_time', - 'fieldtype': u'Time', - 'label': u'Posting Time', - 'no_copy': 1, - 'oldfieldname': u'posting_time', - 'oldfieldtype': u'Time', - 'permlevel': 0, - 'print_hide': 1 - }, - # DocField { 'colour': u'White:FFF', @@ -327,6 +314,18 @@ 'search_index': 0 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'mode_of_payment', + 'fieldtype': u'Select', + 'label': u'Mode of Payment', + 'oldfieldname': u'mode_of_payment', + 'oldfieldtype': u'Select', + 'options': u'link:Mode of Payment', + 'permlevel': 0 + }, + # DocField { 'colour': u'White:FFF', @@ -1091,6 +1090,19 @@ 'print_hide': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'posting_time', + 'fieldtype': u'Time', + 'label': u'Posting Time', + 'no_copy': 1, + 'oldfieldname': u'posting_time', + 'oldfieldtype': u'Time', + 'permlevel': 0, + 'print_hide': 1 + }, + # DocField { 'allow_on_submit': 1, @@ -1106,18 +1118,6 @@ 'print_hide': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'mode_of_payment', - 'fieldtype': u'Select', - 'label': u'Mode of Payment', - 'oldfieldname': u'mode_of_payment', - 'oldfieldtype': u'Select', - 'options': u'link:Mode of Payment', - 'permlevel': 0 - }, - # DocField { 'doctype': u'DocField', From 8cf9934b93a835ae9663cf3bfb9d1cad8792cabf Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 4 May 2012 12:52:56 +0530 Subject: [PATCH 3/9] Trend analyzer issue fixed --- .../search_criteria/trend_analyzer/trend_analyzer.js | 8 +------- .../search_criteria/trend_analyzer/trend_analyzer.py | 8 +------- .../search_criteria/trend_analyzer/trend_analyzer.txt | 6 +++--- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.js b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.js index dd3e75082b..53de71cb21 100644 --- a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.js +++ b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.js @@ -80,14 +80,8 @@ report.get_query = function() { add_col = ''; add_tables = ''; sp_cond = ''; - if(trans == 'Sales Invoice') trans = 'Sales Invoice'; - else if(trans == 'Purchase Invoice') trans = 'Purchase Invoice'; - trans_det = trans+' Detail' - - if(trans == 'Sales Invoice') trans_det = 'Sales Invoice Item'; - else if(trans == 'Purchase Invoice') trans_det = 'Purchase Invoice Item'; - else if(trans == 'Purchase Order') trans_det = 'Purchase Order Item'; + trans_det = trans+' Item' if(order_type != '') add_code += ' AND t1.order_type = '+order_type; diff --git a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.py b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.py index 278cfd6c78..4a7d0939c6 100644 --- a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.py +++ b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.py @@ -39,14 +39,8 @@ project = filter_values.get('project') # ********************************************* SET DEFAULTS ************************************************** # Details Table # -------------- -if trans == 'Sales Invoice': trans = 'Sales Invoice' -elif trans == 'Purchase Invoice': trans = 'Purchase Invoice' -trans_det = trans+' Detail' - -if trans == 'Sales Invoice': trans_det = 'Sales Invoice Item' -elif trans == 'Purchase Invoice': trans_det = 'Purchase Invoice Item' -elif trans == 'Purchase Order': trans_det = 'Purchase Order Item' +trans_det = trans+' Item' col_names, query_val = get_obj('Trend Analyzer Control').get_single_year_query_value(fiscal_year, period, trans, trans_det) query_val += 'SUM(t2.qty), SUM(t2.amount)' diff --git a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.txt b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.txt index 93a60e05c2..a1cf3e4ae1 100644 --- a/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.txt +++ b/erpnext/accounts/search_criteria/trend_analyzer/trend_analyzer.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-04-03 12:49:53', + 'creation': '2012-04-23 12:46:00', 'docstatus': 0, - 'modified': '2012-04-03 12:49:53', + 'modified': '2012-05-04 12:49:43', 'modified_by': u'Administrator', 'owner': u'saumil@webnotestech.com' }, @@ -30,4 +30,4 @@ 'doctype': 'Search Criteria', 'name': u'trend_analyzer' } -] +] \ No newline at end of file From cc1583de885dce3d26759bcde956025212de82d3 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 4 May 2012 13:04:40 +0530 Subject: [PATCH 4/9] fix in landed cost master --- .../doctype/landed_cost_item/landed_cost_item.txt | 6 +++--- .../landed_cost_master_detail.txt | 12 +++++++----- js/all-app.js | 10 +++++----- js/all-web.js | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt index 41570395fd..06f765dc7e 100644 --- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt +++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:33', + 'creation': '2012-05-03 11:00:55', 'docstatus': 0, - 'modified': '2012-03-27 14:36:33', + 'modified': '2012-05-04 13:02:26', 'modified_by': u'Administrator', 'owner': u'wasim@webnotestech.com' }, @@ -21,7 +21,7 @@ 'section_style': u'Simple', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 2 + 'version': 1 }, # These values are common for all DocField diff --git a/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt b/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt index 1becceaf65..74e47e1923 100644 --- a/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt +++ b/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:34', + 'creation': '2012-05-03 11:00:55', 'docstatus': 0, - 'modified': '2012-03-27 14:36:34', + 'modified': '2012-05-04 13:02:35', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -19,13 +19,12 @@ 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', - 'version': 2 + 'version': 1 }, # These values are common for all DocField { 'doctype': u'DocField', - 'fieldtype': u'Data', 'name': '__common__', 'oldfieldtype': u'Data', 'parent': u'Landed Cost Master Detail', @@ -44,14 +43,17 @@ { 'doctype': u'DocField', 'fieldname': u'account_head', + 'fieldtype': u'Link', 'label': u'Account Head', - 'oldfieldname': u'account_head' + 'oldfieldname': u'account_head', + 'options': u'Account' }, # DocField { 'doctype': u'DocField', 'fieldname': u'description', + 'fieldtype': u'Data', 'label': u'Description', 'oldfieldname': u'description', 'width': u'300px' diff --git a/js/all-app.js b/js/all-app.js index a292e4633b..97ece36d5c 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -331,8 +331,8 @@ if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:funct /* * lib/js/wn/ui/filters.js */ -wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length) -this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field) +wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').toggle();if(!this.filters.length) +this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').toggle(true);}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field) values.push(f.get_value());}) return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);}) this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname) @@ -1045,7 +1045,7 @@ $(me.loading_img).toggle(false);}});this.make();} /* * lib/js/wn/ui/search.js */ -wn.ui.Search=Class.extend({init:function(opts){$.extend(this,opts);var me=this;wn.model.with_doctype(this.doctype,function(r){me.make();me.dialog.show();});},make:function(){var me=this;this.dialog=new wn.ui.Dialog({title:this.doctype+' Search',width:500});this.list=new wn.ui.Listing({parent:$(this.dialog.body),appframe:this.dialog.appframe,new_doctype:this.doctype,doctype:this.doctype,method:'webnotes.widgets.doclistview.get',show_filters:true,style:'compact',get_args:function(){if(me.query){me.page_length=50;return{query:me.query}}else{return{doctype:me.doctype,fields:['`tab'+me.doctype+'`.name'],filters:me.list.filter_list.get_filters(),docstatus:['0','1']}}},render_row:function(parent,data){$ln=$('' +wn.ui.Search=Class.extend({init:function(opts){$.extend(this,opts);var me=this;wn.model.with_doctype(this.doctype,function(r){me.make();me.dialog.show();me.list.$w.find('.list-filters input[type="text"]').focus();});},make:function(){var me=this;this.dialog=new wn.ui.Dialog({title:this.doctype+' Search',width:500});this.list=new wn.ui.Listing({parent:$(this.dialog.body),appframe:this.dialog.appframe,new_doctype:this.doctype,doctype:this.doctype,method:'webnotes.widgets.doclistview.get',show_filters:true,style:'compact',get_args:function(){if(me.query){me.page_length=50;return{query:me.query}}else{return{doctype:me.doctype,fields:['`tab'+me.doctype+'`.name'],filters:me.list.filter_list.get_filters(),docstatus:['0','1']}}},render_row:function(parent,data){$ln=$('' +data.name+'').appendTo(parent).click(function(){var val=$(this).attr('data-name');me.dialog.hide();if(me.callback) me.callback(val);else wn.set_route('Form',me.doctype,val);});}});this.list.filter_list.add_filter('name','like');this.list.run();}}) @@ -1719,7 +1719,7 @@ _f.Frm.prototype.check_doctype_conflict=function(docname){var me=this;if(this.do throw'doctype open conflict'}}else{if(wn.views.formview.DocType&&wn.views.formview.DocType.frm.opendocs[this.doctype]){msgprint("Cannot open instance when its DocType is open") throw'doctype open conflict'}}} _f.Frm.prototype.setup=function(){var me=this;this.fields=[];this.fields_dict={};this.wrapper=this.parent;this.setup_print_layout();this.saved_wrapper=$a(this.wrapper,'div');this.setup_std_layout();this.setup_client_script();this.setup_done=true;} -_f.Frm.prototype.setup_print_layout=function(){this.print_wrapper=$a(this.wrapper,'div');this.print_head=$a(this.print_wrapper,'div');this.print_body=$a(this.print_wrapper,'div','layout_wrapper',{padding:'23px',minHeight:'800px'});var t=make_table(this.print_head,1,2,'100%',[],{padding:'6px'});this.view_btn_wrapper=$a($td(t,0,0),'span','green_buttons');this.view_btn=$btn(this.view_btn_wrapper,'View Details',function(){cur_frm.edit_doc()},{marginRight:'4px'},'green');this.print_btn=$btn($td(t,0,0),'Print',function(){cur_frm.print_doc()});$y($td(t,0,1),{textAlign:'right'});this.print_close_btn=$btn($td(t,0,1),'Close',function(){window.back();});} +_f.Frm.prototype.setup_print_layout=function(){this.print_wrapper=$a(this.wrapper,'div');this.print_head=$a(this.print_wrapper,'div');this.print_body=$a(this.print_wrapper,'div','layout_wrapper',{padding:'23px',minHeight:'800px'});var t=make_table(this.print_head,1,2,'100%',[],{padding:'6px'});this.view_btn_wrapper=$a($td(t,0,0),'span','green_buttons');this.view_btn=$btn(this.view_btn_wrapper,'View Details',function(){cur_frm.edit_doc()},{marginRight:'4px'},'green');this.print_btn=$btn($td(t,0,0),'Print',function(){cur_frm.print_doc()});$y($td(t,0,1),{textAlign:'right'});this.print_close_btn=$btn($td(t,0,1),'Close',function(){window.history.back();});} _f.Frm.prototype.onhide=function(){if(_f.cur_grid_cell)_f.cur_grid_cell.grid.cell_deselect();} _f.Frm.prototype.setup_std_layout=function(){this.page_layout=new wn.PageLayout({parent:this.wrapper,main_width:this.meta.in_dialog?'100%':'75%',sidebar_width:this.meta.in_dialog?'0%':'25%'}) this.meta.section_style='Simple';this.layout=new Layout(this.page_layout.body,'100%');if(this.meta.in_dialog){$(this.page_layout.wrapper).removeClass('layout-wrapper-background');$(this.page_layout.main).removeClass('layout-main-section');$(this.page_layout.sidebar_area).toggle(false);}else{this.setup_sidebar();} @@ -2009,7 +2009,7 @@ _p.def_print_style_other="\n.simpletable, .noborder { border-collapse: collapse; _p.go=function(html){var d=document.createElement('div') d.innerHTML=html $(d).printElement();} -_p.preview=function(html){var w=window.open('');w.document.write(html) +_p.preview=function(html){var w=window.open('');if(!w)return;w.document.write(html) w.document.close();} $.extend(_p,{show_dialog:function(){if(!_p.dialog){_p.make_dialog();} _p.dialog.show();},make_dialog:function(){var d=new Dialog(360,140,'Print Formats',[['HTML','Select'],['Check','No Letterhead'],['HTML','Buttons']]);$btn(d.widgets.Buttons,'Print',function(){_p.build(sel_val(cur_frm.print_sel),_p.go,d.widgets['No Letterhead'].checked);},{cssFloat:'right',marginBottom:'16px',marginLeft:'7px'},'green');$btn(d.widgets.Buttons,'Preview',function(){_p.build(sel_val(cur_frm.print_sel),_p.preview,d.widgets['No Letterhead'].checked);},{cssFloat:'right',marginBottom:'16px'},'');d.onshow=function(){var c=_p.dialog.widgets['Select'];if(c.cur_sel&&c.cur_sel.parentNode==c){c.removeChild(c.cur_sel);} diff --git a/js/all-web.js b/js/all-web.js index 2430e89507..f90f6148bc 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -218,8 +218,8 @@ if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:funct /* * lib/js/wn/ui/filters.js */ -wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length) -this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field) +wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').toggle();if(!this.filters.length) +this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').toggle(true);}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field) values.push(f.get_value());}) return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);}) this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname) From bc1d74dbfef1f7310147399a3831cb9dab6153ff Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 4 May 2012 13:13:44 +0530 Subject: [PATCH 5/9] fix in landed cost master query --- .../stock/doctype/landed_cost_master/landed_cost_master.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js b/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js index 3cad9447a9..03e8a39fd0 100644 --- a/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js +++ b/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js @@ -23,4 +23,8 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc, cdt, cdn) { +} + +cur_frm.fields_dict.landed_cost.grid.get_field('account_head').get_query = function(doc, cdt, cdn) { + return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type = "Tax" OR tabAccount.account_type = "Chargeable" or (tabAccount.is_pl_account = "Yes" and tabAccount.debit_or_credit = "Debit")) AND tabAccount.name LIKE "%s"'; } \ No newline at end of file From 29d36a6cea587d8870f66a9fb8812691588a0694 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 4 May 2012 16:20:30 +0530 Subject: [PATCH 6/9] fixes in account setup --- erpnext/setup/doctype/setup_control/setup_control.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/setup_control/setup_control.py b/erpnext/setup/doctype/setup_control/setup_control.py index d5832c4e03..bcdd0938da 100644 --- a/erpnext/setup/doctype/setup_control/setup_control.py +++ b/erpnext/setup/doctype/setup_control/setup_control.py @@ -81,7 +81,12 @@ class DocType: # Set self.set_defaults(def_args) - self.set_cp_defaults(**args) + + cp_args = {} + for k in ['industry', 'country', 'timezone', 'company_name']: + cp_args[k] = args[k] + + self.set_cp_defaults(**cp_args) self.create_feed_and_todo() From ce4d2976414e17aa620e2f5906be794cdd3b9a57 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 4 May 2012 17:55:32 +0530 Subject: [PATCH 7/9] rename dt in custom search criteria --- .../renamedt_in_custom_search_criteria.py | 99 +++++++++++++++++++ erpnext/patches/patch_list.py | 5 + 2 files changed, 104 insertions(+) create mode 100644 erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py diff --git a/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py b/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py new file mode 100644 index 0000000000..3ac1f8e0fb --- /dev/null +++ b/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py @@ -0,0 +1,99 @@ +def execute(): + import webnotes + rendt = { + 'Receivable Voucher' : 'Sales Invoice', + 'RV Detail' : 'Sales Invoice Item', + 'RV Tax Detail' : 'Sales Taxes and Charges', + 'Payable Voucher' : 'Purchase Invoice', + 'PV Detail' : 'Purchase Invoice Item', + 'Purchase Tax Detail' : 'Purchase Taxes and Charges', + 'Indent' : 'Purchase Request', + 'Indent Detail' : 'Purchase Request Item', + 'QA Inspection Report' : 'Quality Inspection', + 'Ticket' : 'Task', + 'Manage Account' : 'Global Defaults', + 'ToDo Item' : 'ToDo', + 'Term' : 'Terms and Conditions', + 'Static Parameter Detail' : 'SMS Parameter', + 'SS Earning Detail' : 'Salary Slip Earning', + 'SS Deduction Detail' : 'Salary Slip Deduction', + 'Sales Order Detail' : 'Sales Order Item', + 'Sales BOM Detail' : 'Sales BOM Item', + 'Return Detail' : 'Sales and Purchase Return Item', + 'Ref Rate Detail' : 'Item Price', + 'Receiver Detail' : 'SMS Receiver', + 'Quotation Detail' : 'Quotation Item', + 'QA Specification Detail' : 'Quality Inspection Reading', + 'Purchase Receipt Detail' : 'Purchase Receipt Item', + 'Purchase Other Charges' : 'Purchase Taxes and Charges Master', + 'PR Raw Material Detail' : 'Purchase Receipt Item Supplied', + 'PP SO Detail' : 'Production Plan Sales Order', + 'PP Detail' : 'Production Plan Item', + 'PO Raw Material Detail' : 'Purchase Order Item Supplied', + 'PO Detail' : 'Purchase Order Item', + 'Packing Slip Detail' : 'Packing Slip Item', + 'Other Charges' : 'Sales Taxes and Charges Master', + 'Order Lost Reason' : 'Quotation Lost Reason', + 'Manage Account' : 'Global Defaults', + 'Maintenance Visit Detail' : 'Maintenance Visit Purpose', + 'Ledger Balance Export' : 'Multi Ledger Report', + 'LC PR Detail' : 'Landed Cost Purchase Receipt', + 'Landed Cost Detail' : 'Landed Cost Item', + 'KRA Template' : 'Appraisal Template', + 'KRA Sheet' : 'Appraisal Template Goal', + 'Item Specification Detail' : 'Item Quality Inspection Parameter', + 'Item Maintenance Detail' : 'Maintenance Schedule Item', + 'IR Payment Detail' : 'Payment to Invoice Matching Tool Detail', + 'Internal Reconciliation' : 'Payment to Invoice Matching Tool', + 'Installed Item Details' : 'Installation Note Item', + 'Holiday List Detail' : 'Holiday', + 'Follow up' : 'Communication Log', + 'Flat BOM Detail' : 'BOM Explosion Item', + 'Expense Voucher Detail' : 'Expense Claim Detail', + 'Expense Voucher' : 'Expense Claim', + 'Expense Type' : 'Expense Claim Type', + 'Enquiry Detail' : 'Opportunity Item', + 'Enquiry' : 'Opportunity', + 'Earning Detail' : 'Salary Structure Earning', + 'DocLayerField' : 'Customize Form Field', + 'DocLayer' : 'Customize Form', + 'Delivery Note Detail' : 'Delivery Note Item', + 'Deduction Detail' : 'Salary Structure Deduction', + 'Comment Widget Record' : 'Comment', + 'BOM Material' : 'BOM Item', + 'Bill Of Materials' : 'BOM', + 'Appraisal Detail' : 'Appraisal Goal', + 'Advance Allocation Detail' : 'Purchase Invoice Advance', + 'Advance Adjustment Detail' : 'Sales Invoice Advance', + 'Ledger Detail' : 'Multi Ledger Report Detail', + 'TA Control' : 'Trend Analyzer Control', + 'Sales and Purchase Return Wizard' : 'Sales and Purchase Return Tool', + 'Educational Qualifications Detail' : 'Employee Education', + 'Delivery Note Packing Detail' : 'Delivery Note Packing Item', + 'Experience In Company Detail' : 'Employee Internal Work History', + 'Professional Training Details' : 'Employee Training', + 'Previous Experience Detail' : 'Employee External Work History', + } + + for d in rendt: + webnotes.conn.sql(""" + update + `tabSearch Criteria` + set + doc_type = replace(doc_type, %s, %s), + filters = replace(filters, %s, %s), + columns = replace(columns, %s, %s), + parent_doc_type = replace(parent_doc_type, %s, %s), + add_cond = replace(add_cond, %s, %s), + add_col = replace(add_col, %s, %s), + add_tab = replace(add_tab, %s, %s), + dis_filters = replace(dis_filters, %s, %s), + group_by = replace(group_by, %s, %s), + sort_by = replace(sort_by, %s, %s), + report_script = replace(report_script, %s, %s), + server_script = replace(server_script, %s, %s), + custom_query = replace(custom_query, %s, %s) + """, (d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], + d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d])) + + diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index d6d689f441..01f4a0efdd 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -327,5 +327,10 @@ patch_list = [ 'patch_file': 'cleanup_notification_control', 'description': 'cleanup notification control' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'renamedt_in_custom_search_criteria', + 'description': 'raname dt in custom search criteria' + }, ] From 875ccac151d101b30b5b0b37f981cdeff5e197f5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 4 May 2012 18:48:30 +0530 Subject: [PATCH 8/9] stock reco cancellation issue fxed --- .../stock_reconciliation.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index e82a0d94f5..ee81518623 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -51,16 +51,16 @@ class DocType: """Convert csv data into list""" count = 2 for s in data: - if s[0].strip() != 'Item Code': # remove the labels - # validate - if (submit and len(s) != 4) or (not submit and len(s) != 6): - msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1) - self.validated = 0 - self.validate_item(s[0], count) - self.validate_warehouse(s[1], count) + if count == 2: continue + # validate + if (submit and len(s) != 4) or (not submit and len(s) != 6): + msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1) + self.validated = 0 + self.validate_item(s[0], count) + self.validate_warehouse(s[1], count) - self.data.append(s) - count += 1 + self.data.append(s) + count += 1 if not self.validated: raise Exception @@ -175,7 +175,7 @@ class DocType: """Add diffs column in attached file""" # add header - out = "'Item Code', 'Warehouse', 'Qty', 'Valuation Rate', 'Qty Diff', 'Val Rate Diff'" + out = "Item Code, Warehouse, Qty, Valuation Rate, Qty Diff, Val Rate Diff" # add data for d in self.data: From f36aee2c6ba1d2034bf1cad3881b2630627702c5 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Sat, 5 May 2012 20:05:58 +0530 Subject: [PATCH 9/9] fix in contact address saving issue --- erpnext/utilities/doctype/contact/contact.js | 2 +- js/all-app.js | 9 ++++----- js/all-web.js | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/erpnext/utilities/doctype/contact/contact.js b/erpnext/utilities/doctype/contact/contact.js index 9244b79fc3..ae06ed4203 100644 --- a/erpnext/utilities/doctype/contact/contact.js +++ b/erpnext/utilities/doctype/contact/contact.js @@ -15,7 +15,7 @@ // along with this program. If not, see . //--------- ONLOAD ------------- -cur_frm.cscript.onload = function(doc, cdt, cdn) { +cur_frm.cscript.onload = function(doc, cdt, cdn) { if(doc.customer) cur_frm.add_fetch('customer', 'customer_name', 'customer_name'); if(doc.supplier) cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name'); diff --git a/js/all-app.js b/js/all-app.js index 97ece36d5c..65ca12478c 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -1314,7 +1314,7 @@ LocalDB.delete_doc=function(dt,dn){var doc=get_local(dt,dn);for(var ndt in local delete locals[dt][dn];} function get_local(dt,dn){return locals[dt]?locals[dt][dn]:null;} LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i' +(cur_frm.message_after_save?cur_frm.message_after_save:'Your information has been sent. Thank you!') +'';return;} -if(!me.meta.istable){me.refresh();} +if(!me.meta.istable){me.refresh(r.docname);} if(call_back){call_back(r);}} var me=this;var ret_fn_err=function(r){var doc=locals[me.doctype][me.docname];me.savingflag=false;ret_fn(r);} this.savingflag=true;if(this.docname&&validated){scroll(0,0);return this.savedoc(save_action,ret_fn,ret_fn_err);}} diff --git a/js/all-web.js b/js/all-web.js index 24ee8f4aaf..00d396acfe 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -758,7 +758,7 @@ LocalDB.delete_doc=function(dt,dn){var doc=get_local(dt,dn);for(var ndt in local delete locals[dt][dn];} function get_local(dt,dn){return locals[dt]?locals[dt][dn]:null;} LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i