From ec1f69ddb96955b7d10b55e2523472eca67ea910 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 25 Jun 2013 12:17:43 +0530 Subject: [PATCH 1/4] [reports][fix] removed old reports --- patches/august_2012/remove_cash_flow_statement.py | 4 ---- patches/december_2012/deprecate_tds.py | 1 - .../reload_debtors_creditors_ledger.py | 5 ----- patches/february_2013/p03_material_request.py | 2 -- .../remove_sales_order_pending_items.py | 3 --- .../deprecate_stock_search_criteria.py | 9 --------- .../january_2013/remove_support_search_criteria.py | 4 ---- patches/july_2012/sync_trial_balance.py | 5 ----- patches/june_2012/reports_list_permission.py | 1 - .../may_2012/reload_customer_address_contact.py | 5 ----- patches/may_2012/reload_reports.py | 7 ------- patches/may_2012/reload_so_pending_items.py | 9 --------- patches/patch_list.py | 14 -------------- 13 files changed, 69 deletions(-) delete mode 100644 patches/august_2012/remove_cash_flow_statement.py delete mode 100644 patches/december_2012/reload_debtors_creditors_ledger.py delete mode 100644 patches/february_2013/remove_sales_order_pending_items.py delete mode 100644 patches/january_2013/deprecate_stock_search_criteria.py delete mode 100644 patches/january_2013/remove_support_search_criteria.py delete mode 100644 patches/july_2012/sync_trial_balance.py delete mode 100644 patches/may_2012/reload_customer_address_contact.py delete mode 100644 patches/may_2012/reload_reports.py delete mode 100644 patches/may_2012/reload_so_pending_items.py diff --git a/patches/august_2012/remove_cash_flow_statement.py b/patches/august_2012/remove_cash_flow_statement.py deleted file mode 100644 index 739a4f2709..0000000000 --- a/patches/august_2012/remove_cash_flow_statement.py +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - webnotes.conn.sql("delete from `tabSearch Criteria` where name = 'cash_flow_statement'") \ No newline at end of file diff --git a/patches/december_2012/deprecate_tds.py b/patches/december_2012/deprecate_tds.py index e351fd9f75..f3daeb0db7 100644 --- a/patches/december_2012/deprecate_tds.py +++ b/patches/december_2012/deprecate_tds.py @@ -15,7 +15,6 @@ def execute(): webnotes.conn.sql("drop table if exists `tab%s`" % dt) webnotes.conn.begin() - delete_doc("Search Criteria", "tds_return") # Add tds entry in tax table for purchase invoice pi_list = webnotes.conn.sql("""select name from `tabPurchase Invoice` diff --git a/patches/december_2012/reload_debtors_creditors_ledger.py b/patches/december_2012/reload_debtors_creditors_ledger.py deleted file mode 100644 index 7f88a6f47d..0000000000 --- a/patches/december_2012/reload_debtors_creditors_ledger.py +++ /dev/null @@ -1,5 +0,0 @@ -def execute(): - import webnotes - from webnotes.modules import reload_doc - reload_doc("accounts", "search_criteria", "debtors_ledger") - reload_doc("accounts", "search_criteria", "creditors_ledger") \ No newline at end of file diff --git a/patches/february_2013/p03_material_request.py b/patches/february_2013/p03_material_request.py index f0373bdffb..d85710d2a8 100644 --- a/patches/february_2013/p03_material_request.py +++ b/patches/february_2013/p03_material_request.py @@ -8,8 +8,6 @@ def execute(): webnotes.rename_doc("DocType", "Purchase Request Item", "Material Request Item", force=True) if not "tabMaterial Request" in tables: webnotes.rename_doc("DocType", "Purchase Request", "Material Request", force=True) - webnotes.reload_doc("buying", "search_criteria", "pending_po_items_to_bill") - webnotes.reload_doc("buying", "search_criteria", "pending_po_items_to_receive") webnotes.reload_doc("stock", "doctype", "material_request") webnotes.reload_doc("stock", "doctype", "material_request_item") diff --git a/patches/february_2013/remove_sales_order_pending_items.py b/patches/february_2013/remove_sales_order_pending_items.py deleted file mode 100644 index bde6a7b240..0000000000 --- a/patches/february_2013/remove_sales_order_pending_items.py +++ /dev/null @@ -1,3 +0,0 @@ -def execute(): - import webnotes - webnotes.delete_doc("Search Criteria", "sales_order_pending_items") \ No newline at end of file diff --git a/patches/january_2013/deprecate_stock_search_criteria.py b/patches/january_2013/deprecate_stock_search_criteria.py deleted file mode 100644 index d51aadb5cf..0000000000 --- a/patches/january_2013/deprecate_stock_search_criteria.py +++ /dev/null @@ -1,9 +0,0 @@ -import webnotes - -def execute(): - for sc in ["itemwise_price_list", "itemwise_receipt_details", - "shortage_to_purchase_request", "stock_aging_report", - "stock_ledger", "stock_level", "stock_report", - "custom_test2", "custom_test3", "custom_test4", - "test_so2", "test_so3"]: - webnotes.delete_doc("Search Criteria", sc) \ No newline at end of file diff --git a/patches/january_2013/remove_support_search_criteria.py b/patches/january_2013/remove_support_search_criteria.py deleted file mode 100644 index 0443afeeda..0000000000 --- a/patches/january_2013/remove_support_search_criteria.py +++ /dev/null @@ -1,4 +0,0 @@ -import webnotes -def execute(): - for sc in ["warranty-amc_expiry_details", "warranty-amc_summary"]: - webnotes.delete_doc("Search Criteria", sc) \ No newline at end of file diff --git a/patches/july_2012/sync_trial_balance.py b/patches/july_2012/sync_trial_balance.py deleted file mode 100644 index 3755ed442b..0000000000 --- a/patches/july_2012/sync_trial_balance.py +++ /dev/null @@ -1,5 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('accounts', 'search_criteria', 'trial_balance') \ No newline at end of file diff --git a/patches/june_2012/reports_list_permission.py b/patches/june_2012/reports_list_permission.py index e34eb5ae46..e88e8fbc60 100644 --- a/patches/june_2012/reports_list_permission.py +++ b/patches/june_2012/reports_list_permission.py @@ -8,7 +8,6 @@ def execute(): webnotes.conn.commit() - webnotes.reload_doc('core', 'doctype', 'search_criteria') webnotes.reload_doc('core', 'doctype', 'report') webnotes.conn.begin() \ No newline at end of file diff --git a/patches/may_2012/reload_customer_address_contact.py b/patches/may_2012/reload_customer_address_contact.py deleted file mode 100644 index 4aec19d02d..0000000000 --- a/patches/may_2012/reload_customer_address_contact.py +++ /dev/null @@ -1,5 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - import webnotes.modules - webnotes.modules.reload_doc('selling', 'search_criteria', 'customer_address_contact') \ No newline at end of file diff --git a/patches/may_2012/reload_reports.py b/patches/may_2012/reload_reports.py deleted file mode 100644 index 1cee3a0061..0000000000 --- a/patches/may_2012/reload_reports.py +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('selling', 'search_criteria', 'itemwise_sales_details') - reload_doc('selling', 'search_criteria', 'itemwise_delivery_details') - diff --git a/patches/may_2012/reload_so_pending_items.py b/patches/may_2012/reload_so_pending_items.py deleted file mode 100644 index 999004e1fe..0000000000 --- a/patches/may_2012/reload_so_pending_items.py +++ /dev/null @@ -1,9 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.model import delete_doc - delete_doc("Search Criteria", "sales_order_pending_items1") - - webnotes.conn.sql("update `tabSearch Criteria` set module = 'Selling' where module = 'CRM'") - from webnotes.modules import reload_doc - reload_doc('selling', 'search_criteria', 'sales_order_pending_items') \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 0353c74b1e..efd4d51cce 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -38,19 +38,15 @@ patch_list = [ "patches.may_2012.cleanup_property_setter", "patches.may_2012.rename_prev_doctype", "patches.may_2012.cleanup_notification_control", - "patches.may_2012.renamedt_in_custom_search_criteria", "patches.may_2012.stock_reco_patch", - "patches.may_2012.reload_reports", "patches.may_2012.page_role_series_fix", "patches.may_2012.reload_sales_invoice_pf", "patches.may_2012.std_pf_readonly", - "patches.may_2012.reload_so_pending_items", "patches.may_2012.customize_form_cleanup", "patches.may_2012.cs_server_readonly", "patches.may_2012.clear_session_cache", "patches.may_2012.same_purchase_rate_patch", "patches.may_2012.create_report_manager_role", - "patches.may_2012.reload_customer_address_contact", "patches.may_2012.profile_perm_patch", "patches.may_2012.remove_euro_currency", "patches.may_2012.remove_communication_log", @@ -81,7 +77,6 @@ patch_list = [ "patches.august_2012.task_allocated_to_assigned", "patches.august_2012.change_profile_permission", "patches.august_2012.repost_billed_amt", - "patches.august_2012.remove_cash_flow_statement", "patches.september_2012.stock_report_permissions_for_accounts", "patches.september_2012.communication_delete_permission", "patches.september_2012.all_permissions_patch", @@ -123,7 +118,6 @@ patch_list = [ "patches.december_2012.expense_leave_reload", "patches.december_2012.repost_ordered_qty", "patches.december_2012.repost_projected_qty", - "patches.december_2012.reload_debtors_creditors_ledger", "patches.december_2012.website_cache_refactor", "patches.december_2012.production_cleanup", "patches.december_2012.fix_default_print_format", @@ -138,8 +132,6 @@ patch_list = [ "patches.december_2012.remove_project_mapper", "patches.december_2012.update_print_width", "patches.january_2013.remove_bad_permissions", - "patches.january_2013.deprecate_stock_search_criteria", - "patches.january_2013.remove_support_search_criteria", "patches.january_2013.holiday_list_patch", "patches.january_2013.stock_reconciliation_patch", "patches.january_2013.report_permission", @@ -163,7 +155,6 @@ patch_list = [ "patches.february_2013.remove_gl_mapper", "patches.february_2013.reload_bom_replace_tool_permission", "patches.february_2013.payment_reconciliation_reset_values", - "patches.february_2013.remove_sales_order_pending_items", "patches.february_2013.account_negative_balance", "patches.february_2013.remove_account_utils_folder", "patches.february_2013.update_company_in_leave_application", @@ -187,14 +178,11 @@ patch_list = [ "execute:webnotes.delete_doc('DocType', 'Service Quotation Detail')", "patches.february_2013.p06_material_request_mappers", "execute:webnotes.delete_doc('Page', 'Query Report')", - "execute:webnotes.delete_doc('Search Criteria', 'employeewise_balance_leave_report')", - "execute:webnotes.delete_doc('Search Criteria', 'employee_leave_balance_report')", "patches.february_2013.repost_reserved_qty", "execute:webnotes.reload_doc('core', 'doctype', 'report') # 2013-02-25", "execute:webnotes.conn.sql(\"update `tabReport` set report_type=if(ifnull(query, '')='', 'Report Builder', 'Query Report') where is_standard='No'\")", "execute:webnotes.conn.sql(\"update `tabReport` set report_name=name where ifnull(report_name,'')='' and is_standard='No'\")", "patches.february_2013.p08_todo_query_report", - "execute:webnotes.delete_doc('Search Criteria', 'gross_profit') # 2013-02-26", 'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Classic") # 2013-02-26', 'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Modern") # 2013-02-26', 'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Spartan") # 2013-02-26', @@ -208,7 +196,6 @@ patch_list = [ "execute:webnotes.delete_doc('DocType', 'Attendance Control Panel')", "patches.march_2013.p02_get_global_default", "patches.march_2013.p03_rename_blog_to_blog_post", - "execute:webnotes.reload_doc('hr', 'search_criteria', 'monthly_attendance_details')", "patches.march_2013.p04_pos_update_stock_check", "patches.march_2013.p05_payment_reconciliation", "patches.march_2013.p06_remove_sales_purchase_return_tool", @@ -234,7 +221,6 @@ patch_list = [ 'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Modern") # 2013-04-02', 'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Spartan") # 2013-04-02', "patches.april_2013.p04_reverse_modules_list", - "execute:webnotes.delete_doc('Search Criteria', 'time_log_summary')", "patches.april_2013.p04_update_role_in_pages", "patches.april_2013.p05_update_file_data", "patches.april_2013.p06_update_file_size", From 909e8b120f62507ec65afd14592248cf6cc4c619 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 25 Jun 2013 14:08:18 +0530 Subject: [PATCH 2/4] [fix][report] general ledger --- accounts/page/general_ledger/general_ledger.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/accounts/page/general_ledger/general_ledger.js b/accounts/page/general_ledger/general_ledger.js index e612bd8a41..d30772acfd 100644 --- a/accounts/page/general_ledger/general_ledger.js +++ b/accounts/page/general_ledger/general_ledger.js @@ -232,7 +232,6 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({ grouped_ledgers[item.account].totals.debit += item.debit; grouped_ledgers[item.account].totals.credit += item.credit; - grouped_ledgers[item.account].entries_group_by_voucher[item.voucher_no] .totals.debit += item.debit; grouped_ledgers[item.account].entries_group_by_voucher[item.voucher_no] @@ -248,8 +247,8 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({ grouped_ledgers[item.account].entries.push(item); if(grouped_ledgers[item.account].entries_group_by_voucher[item.voucher_no].row){ - grouped_ledgers[item.account]. - entries_group_by_voucher[item.voucher_no].row = item; + grouped_ledgers[item.account].entries_group_by_voucher[item.voucher_no] + .row = jQuery.extend({}, item); } } } @@ -321,7 +320,7 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({ $.each(Object.keys(grouped_ledgers).sort(), function(i, account) { if(grouped_ledgers[account].entries.length) { $.each(Object.keys(grouped_ledgers[account].entries_group_by_voucher).sort(), - function(j, voucher) { + function(j, voucher) { voucher_dict = grouped_ledgers[account].entries_group_by_voucher[voucher]; if(voucher_dict.totals.debit || voucher_dict.totals.credit) { voucher_dict.row.debit = voucher_dict.totals.debit; From cca41a172cf397747f5300cf49e3ad3ca6331002 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 25 Jun 2013 14:14:32 +0530 Subject: [PATCH 3/4] [fix][report] general ledger --- accounts/page/general_ledger/general_ledger.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accounts/page/general_ledger/general_ledger.js b/accounts/page/general_ledger/general_ledger.js index d30772acfd..269ed5e3f2 100644 --- a/accounts/page/general_ledger/general_ledger.js +++ b/accounts/page/general_ledger/general_ledger.js @@ -319,10 +319,11 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({ var out = [] $.each(Object.keys(grouped_ledgers).sort(), function(i, account) { if(grouped_ledgers[account].entries.length) { - $.each(Object.keys(grouped_ledgers[account].entries_group_by_voucher).sort(), + $.each(Object.keys(grouped_ledgers[account].entries_group_by_voucher), function(j, voucher) { voucher_dict = grouped_ledgers[account].entries_group_by_voucher[voucher]; - if(voucher_dict.totals.debit || voucher_dict.totals.credit) { + if(voucher_dict && + (voucher_dict.totals.debit || voucher_dict.totals.credit)) { voucher_dict.row.debit = voucher_dict.totals.debit; voucher_dict.row.credit = voucher_dict.totals.credit; voucher_dict.row.id = "entry_grouped_by_" + voucher From 50899d2bd4c53826356d76cb24c6ed13ebc0a28c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 25 Jun 2013 15:17:38 +0530 Subject: [PATCH 4/4] [fix][patch] bom exploded items --- patches/june_2013/p01_update_bom_exploded_items.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/june_2013/p01_update_bom_exploded_items.py b/patches/june_2013/p01_update_bom_exploded_items.py index eff0931e4d..f53eb5bc68 100644 --- a/patches/june_2013/p01_update_bom_exploded_items.py +++ b/patches/june_2013/p01_update_bom_exploded_items.py @@ -23,7 +23,7 @@ def execute(): if bom[0] not in updated_bom: try: bom_obj = webnotes.get_obj("BOM", bom[0], with_children=1) - updated_bom = bom_obj.update_cost_and_exploded_items(updated_bom) + updated_bom += bom_obj.update_cost_and_exploded_items(bom[0]) webnotes.conn.commit() except: pass \ No newline at end of file