From 99e5ac34528663e1dcca7aea534a4a9f03f9aa1d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 13 Sep 2012 15:24:19 +0530 Subject: [PATCH 1/2] multi sort for stock ledger search criteria --- .../august_2012/reload_stock_ledger.py | 4 --- erpnext/patches/patch_list.py | 8 +++--- .../reload_criteria_stock_ledger.py | 7 +++++ .../Report/Stock Ledger/Stock Ledger.txt | 26 ------------------- .../stock_ledger/stock_ledger.txt | 6 ++--- public/js/all-app.js | 2 +- public/js/all-web.js | 2 +- public/js/report-legacy.js | 6 ++--- 8 files changed, 19 insertions(+), 42 deletions(-) delete mode 100644 erpnext/patches/august_2012/reload_stock_ledger.py create mode 100644 erpnext/patches/september_2012/reload_criteria_stock_ledger.py delete mode 100644 erpnext/stock/Report/Stock Ledger/Stock Ledger.txt diff --git a/erpnext/patches/august_2012/reload_stock_ledger.py b/erpnext/patches/august_2012/reload_stock_ledger.py deleted file mode 100644 index d0ec9ee8899..00000000000 --- a/erpnext/patches/august_2012/reload_stock_ledger.py +++ /dev/null @@ -1,4 +0,0 @@ -def execute(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('stock', 'Report', 'Stock Ledger') \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index e4eff963efb..3acd97d1f4f 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -533,10 +533,6 @@ patch_list = [ 'patch_module': 'patches.august_2012', 'patch_file': 'remove_cash_flow_statement', }, - { - 'patch_module': 'patches.august_2012', - 'patch_file': 'reload_stock_ledger', - }, { 'patch_module': 'patches.september_2012', 'patch_file': 'stock_report_permissions_for_accounts', @@ -545,4 +541,8 @@ patch_list = [ 'patch_module': 'patches.september_2012', 'patch_file': 'communication_delete_permission', }, + { + 'patch_module': 'patches.september_2012', + 'patch_file': 'reload_criteria_stock_ledger', + }, ] diff --git a/erpnext/patches/september_2012/reload_criteria_stock_ledger.py b/erpnext/patches/september_2012/reload_criteria_stock_ledger.py new file mode 100644 index 00000000000..4e2e71af33c --- /dev/null +++ b/erpnext/patches/september_2012/reload_criteria_stock_ledger.py @@ -0,0 +1,7 @@ +def execute(): + import webnotes + from webnotes.modules import reload_doc + reload_doc('stock', 'Search Criteria', 'Stock Ledger') + + from webnotes.model import delete_doc + delete_doc("Report", "Stock Ledger") \ No newline at end of file diff --git a/erpnext/stock/Report/Stock Ledger/Stock Ledger.txt b/erpnext/stock/Report/Stock Ledger/Stock Ledger.txt deleted file mode 100644 index d0c5184bba5..00000000000 --- a/erpnext/stock/Report/Stock Ledger/Stock Ledger.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Report, Stock Ledger -[ - - # These values are common in all dictionaries - { - 'creation': '2012-09-06 18:47:05', - 'docstatus': 0, - 'modified': '2012-09-06 18:48:22', - 'modified_by': u'Administrator', - 'owner': u'Administrator' - }, - - # These values are common for all Report - { - 'doctype': 'Report', - 'json': u'{"filters":[["Stock Ledger Entry","is_cancelled","=","No"]],"columns":[["item_code","Stock Ledger Entry"],["warehouse","Stock Ledger Entry"],["posting_date","Stock Ledger Entry"],["posting_time","Stock Ledger Entry"],["actual_qty","Stock Ledger Entry"],["bin_aqat","Stock Ledger Entry"],["voucher_type","Stock Ledger Entry"],["voucher_no","Stock Ledger Entry"]],"sort_by":"Stock Ledger Entry.posting_date","sort_order":"desc","sort_by_next":"Stock Ledger Entry.posting_time","sort_order_next":"desc"}', - 'name': '__common__', - 'ref_doctype': u'Stock Ledger Entry' - }, - - # Report, Stock Ledger - { - 'doctype': 'Report', - 'name': u'Stock Ledger' - } -] \ No newline at end of file diff --git a/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt b/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt index cee810b4f61..5f9cb8cead4 100644 --- a/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt +++ b/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-04-16 11:42:44', + 'creation': '2012-09-13 15:18:44', 'docstatus': 0, - 'modified': '2012-04-16 16:00:35', + 'modified': '2012-09-13 15:19:44', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -23,7 +23,7 @@ 'module': u'Stock', 'name': '__common__', 'page_len': 50, - 'sort_by': u'`tabStock Ledger Entry`.`item_code`', + 'sort_by': u'`tabStock Ledger Entry`.`posting_date` DESC, `tabStock Ledger Entry`.`posting_time` DESC, `tabStock Ledger Entry`.`name` DESC', 'sort_order': u'DESC', 'standard': u'Yes' }, diff --git a/public/js/all-app.js b/public/js/all-app.js index f52272c8efb..18eeac05188 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -400,7 +400,7 @@ wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,f * lib/js/core.js */ if(!console){var console={log:function(txt){}}} -window._version_number="031a31bad930de7f9e8157242afbcba4729d91ff9f957c0c897cafd6";$(document).ready(function(){wn.assets.check();wn.provide('wn.app');$.extend(wn.app,new wn.Application());}); +window._version_number="1e94c62f61174cfb7f98c2bdd377674ef06b81eff2e4d1c2dff88107";$(document).ready(function(){wn.assets.check();wn.provide('wn.app');$.extend(wn.app,new wn.Application());}); /* * lib/js/legacy/globals.js diff --git a/public/js/all-web.js b/public/js/all-web.js index 2c0b0aeae09..b2ba636fd27 100644 --- a/public/js/all-web.js +++ b/public/js/all-web.js @@ -287,7 +287,7 @@ wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,f * lib/js/core.js */ if(!console){var console={log:function(txt){}}} -window._version_number="031a31bad930de7f9e8157242afbcba4729d91ff9f957c0c897cafd6";$(document).ready(function(){wn.assets.check();wn.provide('wn.app');$.extend(wn.app,new wn.Application());}); +window._version_number="1e94c62f61174cfb7f98c2bdd377674ef06b81eff2e4d1c2dff88107";$(document).ready(function(){wn.assets.check();wn.provide('wn.app');$.extend(wn.app,new wn.Application());}); /* * lib/js/legacy/globals.js diff --git a/public/js/report-legacy.js b/public/js/report-legacy.js index 5a3b93fa3da..925386e5397 100644 --- a/public/js/report-legacy.js +++ b/public/js/report-legacy.js @@ -171,10 +171,10 @@ _r.DataTable.prototype.set_asc=function(icon){this.sort_icon.src='images/lib/ico _r.DataTable.prototype.set_sort_option_disabled=function(label,disabled){var s=this.sort_sel;if(disabled){for(var i=0;i Date: Thu, 13 Sep 2012 15:39:34 +0530 Subject: [PATCH 2/2] allow multisort with selectable sort order --- erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt | 6 +++--- public/js/all-app.js | 2 +- public/js/all-web.js | 2 +- public/js/report-legacy.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt b/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt index 5f9cb8cead4..b80578ef0c9 100644 --- a/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt +++ b/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt @@ -5,7 +5,7 @@ { 'creation': '2012-09-13 15:18:44', 'docstatus': 0, - 'modified': '2012-09-13 15:19:44', + 'modified': '2012-09-13 15:38:45', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -23,8 +23,8 @@ 'module': u'Stock', 'name': '__common__', 'page_len': 50, - 'sort_by': u'`tabStock Ledger Entry`.`posting_date` DESC, `tabStock Ledger Entry`.`posting_time` DESC, `tabStock Ledger Entry`.`name` DESC', - 'sort_order': u'DESC', + 'sort_by': u'`tabStock Ledger Entry`.`posting_date`, `tabStock Ledger Entry`.`posting_time`, `tabStock Ledger Entry`.`name`', + 'sort_order': u'ASC', 'standard': u'Yes' }, diff --git a/public/js/all-app.js b/public/js/all-app.js index 18eeac05188..c8548a72ac1 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -400,7 +400,7 @@ wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,f * lib/js/core.js */ if(!console){var console={log:function(txt){}}} -window._version_number="1e94c62f61174cfb7f98c2bdd377674ef06b81eff2e4d1c2dff88107";$(document).ready(function(){wn.assets.check();wn.provide('wn.app');$.extend(wn.app,new wn.Application());}); +window._version_number="6123c7881505af8bdcadcac363d143df24a587186c90a50f40a97664";$(document).ready(function(){wn.assets.check();wn.provide('wn.app');$.extend(wn.app,new wn.Application());}); /* * lib/js/legacy/globals.js diff --git a/public/js/all-web.js b/public/js/all-web.js index b2ba636fd27..fa7fd11a7b5 100644 --- a/public/js/all-web.js +++ b/public/js/all-web.js @@ -287,7 +287,7 @@ wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,f * lib/js/core.js */ if(!console){var console={log:function(txt){}}} -window._version_number="1e94c62f61174cfb7f98c2bdd377674ef06b81eff2e4d1c2dff88107";$(document).ready(function(){wn.assets.check();wn.provide('wn.app');$.extend(wn.app,new wn.Application());}); +window._version_number="6123c7881505af8bdcadcac363d143df24a587186c90a50f40a97664";$(document).ready(function(){wn.assets.check();wn.provide('wn.app');$.extend(wn.app,new wn.Application());}); /* * lib/js/legacy/globals.js diff --git a/public/js/report-legacy.js b/public/js/report-legacy.js index 925386e5397..acf91bcfb22 100644 --- a/public/js/report-legacy.js +++ b/public/js/report-legacy.js @@ -171,7 +171,7 @@ _r.DataTable.prototype.set_asc=function(icon){this.sort_icon.src='images/lib/ico _r.DataTable.prototype.set_sort_option_disabled=function(label,disabled){var s=this.sort_sel;if(disabled){for(var i=0;i