From 4221814131c4d6d5fe0fb2b298481582294f16b0 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:28:19 +0530 Subject: [PATCH 01/11] [patches] [fix] replace sync with reload_doc in old patches --- patches/august_2012/change_profile_permission.py | 3 +-- patches/july_2012/address_contact_perms.py | 5 ++--- patches/july_2012/blog_guest_permission.py | 3 +-- patches/july_2012/project_patch_repeat.py | 7 +++---- patches/july_2012/supplier_quotation.py | 13 ++++++------- patches/june_2012/cms2.py | 11 +++++------ patches/june_2012/copy_uom_for_pur_inv_item.py | 8 +++----- patches/june_2012/reports_list_permission.py | 5 ++--- patches/june_2012/set_recurring_type.py | 3 +-- patches/june_2012/support_ticket_autoreply.py | 3 +-- patches/mar_2012/clean_property_setter.py | 3 +-- patches/mar_2012/create_custom_fields.py | 3 +-- patches/may_2012/cleanup_notification_control.py | 3 +-- patches/may_2012/cs_server_readonly.py | 3 +-- patches/may_2012/profile_perm_patch.py | 3 +-- patches/may_2012/remove_communication_log.py | 3 +-- patches/may_2012/std_pf_readonly.py | 3 +-- 17 files changed, 32 insertions(+), 50 deletions(-) diff --git a/patches/august_2012/change_profile_permission.py b/patches/august_2012/change_profile_permission.py index 27169d8792..7e945d5d9a 100644 --- a/patches/august_2012/change_profile_permission.py +++ b/patches/august_2012/change_profile_permission.py @@ -31,5 +31,4 @@ def execute(): webnotes.conn.commit() webnotes.conn.begin() - import webnotes.model.sync - webnotes.model.sync.sync('core', 'profile') \ No newline at end of file + webnotes.reload_doc('core', 'doctype', 'profile') \ No newline at end of file diff --git a/patches/july_2012/address_contact_perms.py b/patches/july_2012/address_contact_perms.py index 5b79f22937..882cf728a5 100644 --- a/patches/july_2012/address_contact_perms.py +++ b/patches/july_2012/address_contact_perms.py @@ -6,7 +6,6 @@ def execute(): where parent in ('Address', 'Contact')""") webnotes.conn.commit() - import webnotes.model.sync - webnotes.model.sync.sync('utilities', 'address') - webnotes.model.sync.sync('utilities', 'contact') + webnotes.reload_doc('utilities', 'doctype', 'address') + webnotes.reload_doc('utilities', 'doctype', 'contact') webnotes.conn.begin() \ No newline at end of file diff --git a/patches/july_2012/blog_guest_permission.py b/patches/july_2012/blog_guest_permission.py index bc42a9d05c..3fcaa0d291 100644 --- a/patches/july_2012/blog_guest_permission.py +++ b/patches/july_2012/blog_guest_permission.py @@ -6,7 +6,6 @@ def execute(): webnotes.conn.commit() - import webnotes.model.sync - webnotes.model.sync.sync('website', 'blog', 1) + webnotes.reload_doc('website', 'doctype', 'blog') webnotes.conn.begin() diff --git a/patches/july_2012/project_patch_repeat.py b/patches/july_2012/project_patch_repeat.py index bd52522938..e031e35980 100644 --- a/patches/july_2012/project_patch_repeat.py +++ b/patches/july_2012/project_patch_repeat.py @@ -12,8 +12,7 @@ def execute(): and ifnull(t1.project_name, '') = ''""") webnotes.conn.commit() - from webnotes.model.sync import sync - sync("buying", "purchase_order") - sync("buying", "purchase_request") - sync("accounts", "purchase_invoice") + webnotes.reload_doc("buying", "doctype", "purchase_order") + webnotes.reload_doc("buying", "doctype", "purchase_request") + webnotes.reload_doc("accounts", "doctype", "purchase_invoice") webnotes.conn.begin() \ No newline at end of file diff --git a/patches/july_2012/supplier_quotation.py b/patches/july_2012/supplier_quotation.py index 49fa14dc9b..c51399c75b 100644 --- a/patches/july_2012/supplier_quotation.py +++ b/patches/july_2012/supplier_quotation.py @@ -1,13 +1,12 @@ from __future__ import unicode_literals def execute(): """sync supplier quotatoin and create supplier quotation mappers""" - from webnotes.model.sync import sync - sync('buying', 'supplier_quotation') - sync('buying', 'supplier_quotation_item') - sync('buying', 'purchase_request') - sync('buying', 'purchase_request_item') - sync('buying', 'purchase_order') - sync('buying', 'purchase_order_item') + webnotes.reload_doc('buying', 'doctype', 'supplier_quotation') + webnotes.reload_doc('buying', 'doctype', 'supplier_quotation_item') + webnotes.reload_doc('buying', 'doctype', 'purchase_request') + webnotes.reload_doc('buying', 'doctype', 'purchase_request_item') + webnotes.reload_doc('buying', 'doctype', 'purchase_order') + webnotes.reload_doc('buying', 'doctype', 'purchase_order_item') from webnotes.modules import reload_doc reload_doc('buying', 'DocType Mapper', 'Material Request-Supplier Quotation') diff --git a/patches/june_2012/cms2.py b/patches/june_2012/cms2.py index 414af73c00..f912f86278 100644 --- a/patches/june_2012/cms2.py +++ b/patches/june_2012/cms2.py @@ -1,14 +1,13 @@ from __future__ import unicode_literals def execute(): import webnotes - import webnotes.model.sync # sync doctypes required for the patch - webnotes.model.sync.sync('website', 'web_cache') - webnotes.model.sync.sync('website', 'web_page') - webnotes.model.sync.sync('website', 'blog') - webnotes.model.sync.sync('website', 'website_settings') - webnotes.model.sync.sync('stock', 'item') + webnotes.reload_doc('website', 'doctype', 'web_cache') + webnotes.reload_doc('website', 'doctype', 'web_page') + webnotes.reload_doc('website', 'doctype', 'blog') + webnotes.reload_doc('website', 'doctype', 'website_settings') + webnotes.reload_doc('stock', 'doctype', 'item') cleanup() diff --git a/patches/june_2012/copy_uom_for_pur_inv_item.py b/patches/june_2012/copy_uom_for_pur_inv_item.py index b374249942..a22146c6a3 100644 --- a/patches/june_2012/copy_uom_for_pur_inv_item.py +++ b/patches/june_2012/copy_uom_for_pur_inv_item.py @@ -2,11 +2,9 @@ from __future__ import unicode_literals def execute(): import webnotes - # perform sync - import webnotes.model.sync - webnotes.model.sync.sync('buying', 'purchase_order_item') - webnotes.model.sync.sync('accounts', 'purchase_invoice_item') - webnotes.model.sync.sync('stock', 'purchase_receipt_item') + webnotes.reload_doc('buying', 'doctype', 'purchase_order_item') + webnotes.reload_doc('accounts', 'doctype', 'purchase_invoice_item') + webnotes.reload_doc('stock', 'doctype', 'purchase_receipt_item') webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Order Item` t2 set t1.uom = t2.uom where ifnull(t1.po_detail, '') != '' and t1.po_detail = t2.name") webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Receipt Item` t2 set t1.uom = t2.uom where ifnull(t1.pr_detail, '') != '' and t1.pr_detail = t2.name") \ 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 a02f4fa37f..e34eb5ae46 100644 --- a/patches/june_2012/reports_list_permission.py +++ b/patches/june_2012/reports_list_permission.py @@ -8,8 +8,7 @@ def execute(): webnotes.conn.commit() - import webnotes.model.sync - webnotes.model.sync.sync('core', 'search_criteria') - webnotes.model.sync.sync('core', 'report') + 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/june_2012/set_recurring_type.py b/patches/june_2012/set_recurring_type.py index 79dd286fbc..7fb416ed7e 100644 --- a/patches/june_2012/set_recurring_type.py +++ b/patches/june_2012/set_recurring_type.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals def execute(): import webnotes - from webnotes.model.sync import sync - sync('accounts', 'sales_invoice') + webnotes.reload_doc('accounts', 'doctype', 'sales_invoice') webnotes.conn.sql("update `tabSales Invoice` set recurring_type = 'Monthly' where ifnull(convert_into_recurring_invoice, 0) = 1") \ No newline at end of file diff --git a/patches/june_2012/support_ticket_autoreply.py b/patches/june_2012/support_ticket_autoreply.py index 9fb0534bdd..32e095665c 100644 --- a/patches/june_2012/support_ticket_autoreply.py +++ b/patches/june_2012/support_ticket_autoreply.py @@ -4,9 +4,8 @@ def execute(): import webnotes import webnotes.utils - import webnotes.model.sync webnotes.conn.commit() - webnotes.model.sync.sync('setup', 'email_settings') + webnotes.reload_doc('setup', 'doctype', 'email_settings') webnotes.conn.begin() sync_support_mails = webnotes.utils.cint(webnotes.conn.get_value('Email Settings', diff --git a/patches/mar_2012/clean_property_setter.py b/patches/mar_2012/clean_property_setter.py index 08a0a94e1f..a9c7b81f36 100644 --- a/patches/mar_2012/clean_property_setter.py +++ b/patches/mar_2012/clean_property_setter.py @@ -12,8 +12,7 @@ def execute(): clean_docfield_properties() def change_property_setter_fieldnames(): - import webnotes.model.sync - webnotes.model.sync.sync('core', 'property_setter') + webnotes.reload_doc('core', 'doctype', 'property_setter') docfield_list = webnotes.conn.sql("""\ SELECT name, fieldname FROM `tabDocField`""", as_list=1) custom_field_list = webnotes.conn.sql("""\ diff --git a/patches/mar_2012/create_custom_fields.py b/patches/mar_2012/create_custom_fields.py index d4c1a13453..a91c765e5f 100644 --- a/patches/mar_2012/create_custom_fields.py +++ b/patches/mar_2012/create_custom_fields.py @@ -94,8 +94,7 @@ from webnotes.model.code import get_obj from webnotes.model.doc import Document def execute(): - import webnotes.model.sync - webnotes.model.sync.sync('core', 'custom_field') + webnotes.reload_doc('core', 'doctype', 'custom_field') for f in field_list: res = webnotes.conn.sql("""SELECT name FROM `tabCustom Field` WHERE dt=%s AND fieldname=%s""", (f[0], f[1])) diff --git a/patches/may_2012/cleanup_notification_control.py b/patches/may_2012/cleanup_notification_control.py index 25a704e198..1a7730ba5b 100644 --- a/patches/may_2012/cleanup_notification_control.py +++ b/patches/may_2012/cleanup_notification_control.py @@ -25,5 +25,4 @@ def execute(): webnotes.conn.commit() webnotes.conn.begin() - import webnotes.model.sync - webnotes.model.sync.sync('setup', 'notification_control') \ No newline at end of file + webnotes.reload_doc('setup', 'doctype', 'notification_control') \ No newline at end of file diff --git a/patches/may_2012/cs_server_readonly.py b/patches/may_2012/cs_server_readonly.py index b68060682c..51a9b760cf 100644 --- a/patches/may_2012/cs_server_readonly.py +++ b/patches/may_2012/cs_server_readonly.py @@ -27,5 +27,4 @@ def execute(): doc.save() webnotes.conn.commit() webnotes.conn.begin() - import webnotes.model.sync - webnotes.model.sync.sync('core', 'custom_script') \ No newline at end of file + webnotes.reload_doc('core', 'doctype', 'custom_script') \ No newline at end of file diff --git a/patches/may_2012/profile_perm_patch.py b/patches/may_2012/profile_perm_patch.py index 4423fdb15d..29fa9c05be 100644 --- a/patches/may_2012/profile_perm_patch.py +++ b/patches/may_2012/profile_perm_patch.py @@ -19,5 +19,4 @@ def execute(): doc.save() webnotes.conn.commit() webnotes.conn.begin() - import webnotes.model.sync - webnotes.model.sync.sync('core', 'profile') \ No newline at end of file + webnotes.reload_doc('core', 'doctype', 'profile') \ No newline at end of file diff --git a/patches/may_2012/remove_communication_log.py b/patches/may_2012/remove_communication_log.py index e44e673701..b6e7e7d276 100644 --- a/patches/may_2012/remove_communication_log.py +++ b/patches/may_2012/remove_communication_log.py @@ -1,8 +1,7 @@ from __future__ import unicode_literals def execute(): import webnotes - import webnotes.model.sync - webnotes.model.sync.sync('support', 'communication') + webnotes.reload_doc('support', 'doctype', 'communication') webnotes.conn.commit() webnotes.conn.begin() diff --git a/patches/may_2012/std_pf_readonly.py b/patches/may_2012/std_pf_readonly.py index 83b581325c..9fbbfe9a3c 100644 --- a/patches/may_2012/std_pf_readonly.py +++ b/patches/may_2012/std_pf_readonly.py @@ -27,5 +27,4 @@ def execute(): doc.save() webnotes.conn.commit() webnotes.conn.begin() - import webnotes.model.sync - webnotes.model.sync.sync('core', 'print_format') \ No newline at end of file + webnotes.reload_doc('core', 'doctype', 'print_format') \ No newline at end of file From 1d4b5b4ca6e772aecf9cf6ae197f2c9174ab2948 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:35:08 +0530 Subject: [PATCH 02/11] [patches] [fix] removed blog reload --- patches/july_2012/blog_guest_permission.py | 11 ----------- patches/june_2012/cms2.py | 2 -- patches/patch_list.py | 1 - 3 files changed, 14 deletions(-) delete mode 100644 patches/july_2012/blog_guest_permission.py diff --git a/patches/july_2012/blog_guest_permission.py b/patches/july_2012/blog_guest_permission.py deleted file mode 100644 index 3fcaa0d291..0000000000 --- a/patches/july_2012/blog_guest_permission.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import unicode_literals -def execute(): - """allocate read write permission to guest for doctype 'Blog'""" - import webnotes - webnotes.conn.sql("""delete from `tabDocPerm` where parent = 'Blog'""") - - webnotes.conn.commit() - - webnotes.reload_doc('website', 'doctype', 'blog') - - webnotes.conn.begin() diff --git a/patches/june_2012/cms2.py b/patches/june_2012/cms2.py index f912f86278..17b7d23cc1 100644 --- a/patches/june_2012/cms2.py +++ b/patches/june_2012/cms2.py @@ -3,9 +3,7 @@ def execute(): import webnotes # sync doctypes required for the patch - webnotes.reload_doc('website', 'doctype', 'web_cache') webnotes.reload_doc('website', 'doctype', 'web_page') - webnotes.reload_doc('website', 'doctype', 'blog') webnotes.reload_doc('website', 'doctype', 'website_settings') webnotes.reload_doc('stock', 'doctype', 'item') diff --git a/patches/patch_list.py b/patches/patch_list.py index 5475d0f8bc..b7ee2d1b4f 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -74,7 +74,6 @@ patch_list = [ "patches.july_2012.auth_table", "patches.july_2012.remove_event_role_owner_match", "patches.july_2012.deprecate_bulk_rename", - "patches.july_2012.blog_guest_permission", "patches.july_2012.bin_permission", "patches.july_2012.project_patch_repeat", "patches.july_2012.repost_stock_due_to_wrong_packing_list", From c852596f15e82e79d2c7190cea9631c6a4ca13c4 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:37:36 +0530 Subject: [PATCH 03/11] [patches] [fix] removed purchase request reload --- patches/july_2012/project_patch_repeat.py | 1 - patches/july_2012/supplier_quotation.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/patches/july_2012/project_patch_repeat.py b/patches/july_2012/project_patch_repeat.py index e031e35980..b1386614c4 100644 --- a/patches/july_2012/project_patch_repeat.py +++ b/patches/july_2012/project_patch_repeat.py @@ -13,6 +13,5 @@ def execute(): webnotes.conn.commit() webnotes.reload_doc("buying", "doctype", "purchase_order") - webnotes.reload_doc("buying", "doctype", "purchase_request") webnotes.reload_doc("accounts", "doctype", "purchase_invoice") webnotes.conn.begin() \ No newline at end of file diff --git a/patches/july_2012/supplier_quotation.py b/patches/july_2012/supplier_quotation.py index c51399c75b..4b8e66c53c 100644 --- a/patches/july_2012/supplier_quotation.py +++ b/patches/july_2012/supplier_quotation.py @@ -3,8 +3,6 @@ def execute(): """sync supplier quotatoin and create supplier quotation mappers""" webnotes.reload_doc('buying', 'doctype', 'supplier_quotation') webnotes.reload_doc('buying', 'doctype', 'supplier_quotation_item') - webnotes.reload_doc('buying', 'doctype', 'purchase_request') - webnotes.reload_doc('buying', 'doctype', 'purchase_request_item') webnotes.reload_doc('buying', 'doctype', 'purchase_order') webnotes.reload_doc('buying', 'doctype', 'purchase_order_item') From 6febab9f9233e1906f3bf086f01cb67aac1a945e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:40:07 +0530 Subject: [PATCH 04/11] [patches] [fix] fix in an old patch --- patches/july_2012/supplier_quotation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patches/july_2012/supplier_quotation.py b/patches/july_2012/supplier_quotation.py index 4b8e66c53c..0a1ab35ef9 100644 --- a/patches/july_2012/supplier_quotation.py +++ b/patches/july_2012/supplier_quotation.py @@ -1,4 +1,6 @@ from __future__ import unicode_literals +import webnotes + def execute(): """sync supplier quotatoin and create supplier quotation mappers""" webnotes.reload_doc('buying', 'doctype', 'supplier_quotation') From 71c265dee8b3e1a08b1fe708ed56c43f4259b671 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:42:56 +0530 Subject: [PATCH 05/11] [patches] [fix] fix in old patch --- patches/august_2012/report_supplier_quotations.py | 4 ---- patches/patch_list.py | 1 - 2 files changed, 5 deletions(-) delete mode 100644 patches/august_2012/report_supplier_quotations.py diff --git a/patches/august_2012/report_supplier_quotations.py b/patches/august_2012/report_supplier_quotations.py deleted file mode 100644 index 8eaf707c4c..0000000000 --- a/patches/august_2012/report_supplier_quotations.py +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import unicode_literals -def execute(): - from webnotes.modules import reload_doc - reload_doc("buying", "report", "supplier_quotations") diff --git a/patches/patch_list.py b/patches/patch_list.py index b7ee2d1b4f..a3a8ac6a97 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -78,7 +78,6 @@ patch_list = [ "patches.july_2012.project_patch_repeat", "patches.july_2012.repost_stock_due_to_wrong_packing_list", "patches.july_2012.supplier_quotation", - "patches.august_2012.report_supplier_quotations", "patches.august_2012.task_allocated_to_assigned", "patches.august_2012.change_profile_permission", "patches.august_2012.changed_blog_date_format", From 101877276eb24657e4aabfd58cfb6876db93ea11 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:45:06 +0530 Subject: [PATCH 06/11] [patches] [fix] fixed an old patch --- patches/august_2012/changed_blog_date_format.py | 5 ----- patches/patch_list.py | 1 - 2 files changed, 6 deletions(-) delete mode 100644 patches/august_2012/changed_blog_date_format.py diff --git a/patches/august_2012/changed_blog_date_format.py b/patches/august_2012/changed_blog_date_format.py deleted file mode 100644 index df51977be5..0000000000 --- a/patches/august_2012/changed_blog_date_format.py +++ /dev/null @@ -1,5 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.model.bean import Bean - Bean("Website Settings", "Website Settings").save() \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index a3a8ac6a97..57da64c397 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -80,7 +80,6 @@ patch_list = [ "patches.july_2012.supplier_quotation", "patches.august_2012.task_allocated_to_assigned", "patches.august_2012.change_profile_permission", - "patches.august_2012.changed_blog_date_format", "patches.august_2012.repost_billed_amt", "patches.august_2012.remove_cash_flow_statement", "patches.september_2012.stock_report_permissions_for_accounts", From 6e0e1c8fcc64265549439723072324268c0ef723 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:46:32 +0530 Subject: [PATCH 07/11] [patches] [fix] fixed an old patch --- patches/patch_list.py | 1 - patches/september_2012/reload_gross_profit.py | 21 ------------------- 2 files changed, 22 deletions(-) delete mode 100644 patches/september_2012/reload_gross_profit.py diff --git a/patches/patch_list.py b/patches/patch_list.py index 57da64c397..c176a9122d 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -90,7 +90,6 @@ patch_list = [ "patches.september_2012.plot_patch", "patches.september_2012.event_permission", "patches.september_2012.repost_stock", - "patches.september_2012.reload_gross_profit", "patches.september_2012.rebuild_trees", "patches.september_2012.deprecate_account_balance", "patches.september_2012.profile_delete_permission", diff --git a/patches/september_2012/reload_gross_profit.py b/patches/september_2012/reload_gross_profit.py deleted file mode 100644 index 0a3f9efed7..0000000000 --- a/patches/september_2012/reload_gross_profit.py +++ /dev/null @@ -1,21 +0,0 @@ -# ERPNext - web based ERP (http://erpnext.com) -# Copyright (C) 2012 Web Notes Technologies Pvt Ltd -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from __future__ import unicode_literals -def execute(): - # reload gross profit report - from webnotes.modules import reload_doc - reload_doc('selling', 'search_criteria', 'gross_profit') \ No newline at end of file From cae99dbf717d78234e4f25af07c9e6d32d02e203 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:57:45 +0530 Subject: [PATCH 08/11] [patches] [fix] fixed an old patch --- patches/february_2013/p03_material_request.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patches/february_2013/p03_material_request.py b/patches/february_2013/p03_material_request.py index 66b2bf6cbb..f0373bdffb 100644 --- a/patches/february_2013/p03_material_request.py +++ b/patches/february_2013/p03_material_request.py @@ -23,3 +23,7 @@ def execute(): os.system("rm -rf app/hr/doctype/holiday_block_list_allow") os.system("rm -rf app/hr/doctype/holiday_block_list_date") + for dt in ("Purchase Request", "Purchase Request Item"): + if webnotes.conn.exists("DocType", dt): + webnotes.delete_doc("DocType", dt) + \ No newline at end of file From 9a22e3f1db74457de3a8a98475ced773cf42ec92 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 16:13:16 +0530 Subject: [PATCH 09/11] [patches] [fix] fixed an old patch --- patches/april_2013/p05_update_file_data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/april_2013/p05_update_file_data.py b/patches/april_2013/p05_update_file_data.py index 787991251e..abf9985b6e 100644 --- a/patches/april_2013/p05_update_file_data.py +++ b/patches/april_2013/p05_update_file_data.py @@ -9,7 +9,9 @@ def execute(): for doctype in webnotes.conn.sql_list("""select parent from tabDocField where fieldname='file_list'"""): - update_file_list(doctype, singles) + # the other scenario is handled in p07_update_file_data_2 + if doctype in singles: + update_file_list(doctype, singles) webnotes.conn.sql("""delete from tabDocField where fieldname='file_list' and parent=%s""", doctype) From 27ff675a07364f278b4f0a33ce28b230bb9ac9da Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 16:15:19 +0530 Subject: [PATCH 10/11] [patches] [fix] fixed an old patch --- patches/april_2013/p05_update_file_data.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/patches/april_2013/p05_update_file_data.py b/patches/april_2013/p05_update_file_data.py index abf9985b6e..39449a6252 100644 --- a/patches/april_2013/p05_update_file_data.py +++ b/patches/april_2013/p05_update_file_data.py @@ -13,9 +13,6 @@ def execute(): if doctype in singles: update_file_list(doctype, singles) - webnotes.conn.sql("""delete from tabDocField where fieldname='file_list' - and parent=%s""", doctype) - # export_to_files([["DocType", doctype]]) def get_single_doctypes(): From 44a01faff9cb02c3f80cd3f8e19326e999d89442 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 16:17:15 +0530 Subject: [PATCH 11/11] [patches] [fix] fixed an old patch --- patches/april_2013/p07_update_file_data_2.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/patches/april_2013/p07_update_file_data_2.py b/patches/april_2013/p07_update_file_data_2.py index 2405e80d65..0cb44d0c20 100644 --- a/patches/april_2013/p07_update_file_data_2.py +++ b/patches/april_2013/p07_update_file_data_2.py @@ -13,6 +13,4 @@ def execute(): webnotes.conn.sql("""delete from `tabCustom Field` where fieldname='file_list' and parent=%s""", doctype) - webnotes.conn.sql("""delete from `tabDocField` where fieldname='file_list' - and parent=%s""", doctype) \ No newline at end of file