From 4221814131c4d6d5fe0fb2b298481582294f16b0 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 16 May 2013 15:28:19 +0530 Subject: [PATCH 01/14] [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 27169d8792a..7e945d5d9aa 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 5b79f229373..882cf728a53 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 bc42a9d05c4..3fcaa0d2914 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 bd525229388..e031e359800 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 49fa14dc9b7..c51399c75b1 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 414af73c007..f912f86278c 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 b3742499423..a22146c6a3b 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 a02f4fa37f8..e34eb5ae467 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 79dd286fbc3..7fb416ed7e6 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 9fb0534bdd2..32e095665ce 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 08a0a94e1fe..a9c7b81f360 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 d4c1a134538..a91c765e5f2 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 25a704e1987..1a7730ba5be 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 b68060682cf..51a9b760cf0 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 4423fdb15d6..29fa9c05bed 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 e44e6737012..b6e7e7d2761 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 83b581325c8..9fbbfe9a3c3 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/14] [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 3fcaa0d2914..00000000000 --- 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 f912f86278c..17b7d23cc1b 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 5475d0f8bcd..b7ee2d1b4fa 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/14] [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 e031e359800..b1386614c4c 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 c51399c75b1..4b8e66c53c4 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/14] [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 4b8e66c53c4..0a1ab35ef9b 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/14] [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 8eaf707c4cc..00000000000 --- 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 b7ee2d1b4fa..a3a8ac6a97e 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/14] [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 df51977be5d..00000000000 --- 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 a3a8ac6a97e..57da64c397a 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/14] [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 57da64c397a..c176a9122d5 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 0a3f9efed7d..00000000000 --- 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/14] [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 66b2bf6cbba..f0373bdffb7 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/14] [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 787991251e1..abf9985b6ea 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/14] [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 abf9985b6ea..39449a62526 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/14] [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 2405e80d658..0cb44d0c20e 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 From f826b93a75dc96edd463acbb826d1f1acd949407 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 17 May 2013 12:19:50 +0530 Subject: [PATCH 12/14] [patch] set conversion factor in pur invoice and repost stock_received_but_not_billed patch --- .../may_2013/p01_conversion_factor_and_aii.py | 26 +++++++++++++++++++ patches/patch_list.py | 1 + 2 files changed, 27 insertions(+) create mode 100644 patches/may_2013/p01_conversion_factor_and_aii.py diff --git a/patches/may_2013/p01_conversion_factor_and_aii.py b/patches/may_2013/p01_conversion_factor_and_aii.py new file mode 100644 index 00000000000..89d82e010d5 --- /dev/null +++ b/patches/may_2013/p01_conversion_factor_and_aii.py @@ -0,0 +1,26 @@ +import webnotes +from webnotes.utils import cint +from accounts.utils import create_stock_in_hand_jv + +def execute(): + webnotes.conn.auto_commit_on_many_writes = True + + aii_enabled = cint(webnotes.conn.get_value("Global Defaults", None, + "auto_inventory_accounting")) + + if aii_enabled: + create_stock_in_hand_jv(reverse = True) + + webnotes.conn.sql("""update `tabPurchase Invoice Item` pi_item + set conversion_factor = (select ifnull(if(conversion_factor=0, 1, conversion_factor), 1) + from `tabUOM Conversion Detail` + where parent = pi_item.item_code and uom = pi_item.uom + ) + where ifnull(conversion_factor, 0)=0""") + + if aii_enabled: + create_stock_in_hand_jv() + + webnotes.conn.auto_commit_on_many_writes = False + + \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 5475d0f8bcd..74a8af78544 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -251,4 +251,5 @@ patch_list = [ "patches.april_2013.rebuild_sales_browser", "patches.april_2013.p08_price_list_country", "patches.may_2013.repost_stock_for_no_posting_time", + "patches.may_2013.p01_conversion_factor_and_aii", ] \ No newline at end of file From b9669de3ff5c0cb5a6eb8b25383295de59a8ec45 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 17 May 2013 12:21:13 +0530 Subject: [PATCH 13/14] [patch] repost_stock: commit after every 50 --- patches/may_2013/repost_stock_for_no_posting_time.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/may_2013/repost_stock_for_no_posting_time.py b/patches/may_2013/repost_stock_for_no_posting_time.py index 04ceae5ecae..b4d52ec4fc5 100644 --- a/patches/may_2013/repost_stock_for_no_posting_time.py +++ b/patches/may_2013/repost_stock_for_no_posting_time.py @@ -29,6 +29,6 @@ def execute(): except: pass i += 1 - if i%100 == 0: + if i%50 == 0: webnotes.conn.sql("commit") webnotes.conn.sql("start transaction") \ No newline at end of file From 8a7d4f51b40e31af3659e957cbbc4f78f89de8b8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 17 May 2013 12:49:15 +0530 Subject: [PATCH 14/14] [latest updates] --- home/page/latest_updates/latest_updates.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js index 38c00269654..910c1b16028 100644 --- a/home/page/latest_updates/latest_updates.js +++ b/home/page/latest_updates/latest_updates.js @@ -1,4 +1,6 @@ erpnext.updates = [ + ["17th May", ["Patch: Set Conversion Factor for purchase invoice item in all old records. And repost JV to book Stock Received But Not Billed account, if Auto Inventory Integration enabed." + ]], ["2nd May", ["Buying: Warehouse must belong to same company as transaction", "Price List: Added Currency Field. One price list can have only one currency", "Item: Naming can now be by series or item code",