From 89e2dd8dbb043cd8f205d8413e0cc83a6daa05b4 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 10 Dec 2012 19:01:10 +0530 Subject: [PATCH] rename Production --> Manufacturing and delete old patches --- .../supplier_quotation/supplier_quotation.txt | 4 +- home/doctype/home_control/home_control.py | 2 +- home/page/desktop/desktop.css | 4 +- home/page/desktop/desktop.js | 2 +- .../Discount_purchase_cycle.py | 31 -- patches/before_jan_2012/__init__.py | 1 - .../before_jan_2012/accounts_default_form.py | 23 - patches/before_jan_2012/auto_indent.py | 25 - patches/before_jan_2012/c_form_patch.py | 29 -- .../delivery_billing_status_patch.py | 72 --- .../before_jan_2012/deploy_email_digest.py | 113 ----- .../edigest_enable_income_year_to_date.py | 28 -- .../erpnext_structure_cleanup.py | 217 --------- patches/before_jan_2012/index_patch.py | 311 ------------- .../before_jan_2012/install_print_formats.py | 125 ----- patches/before_jan_2012/lcw_patch.py | 26 -- patches/before_jan_2012/p1.py | 21 - patches/before_jan_2012/packing_slip.py | 25 - patches/before_jan_2012/price_list_patch.py | 30 -- .../before_jan_2012/print_hide_price_list.py | 20 - .../profile_mark_not_in_create.py | 27 -- patches/before_jan_2012/project_patch.py | 35 -- patches/before_jan_2012/reload_address.py | 22 - patches/before_jan_2012/reload_bom.py | 22 - patches/before_jan_2012/reload_doclayer.py | 33 -- .../before_jan_2012/reload_email_digest.py | 20 - ...eload_employeewise_balance_leave_report.py | 21 - patches/before_jan_2012/reload_flat_bom.py | 23 - patches/before_jan_2012/reload_gl_mapper.py | 23 - patches/before_jan_2012/reload_lc_wizard.py | 26 -- .../before_jan_2012/reload_print_format.py | 34 -- .../before_jan_2012/reload_project_task.py | 24 - patches/before_jan_2012/reload_reco.py | 23 - patches/before_jan_2012/reload_rv.py | 26 -- .../before_jan_2012/reload_support_ticket.py | 23 - .../remove_duplicate_table_mapper_detail.py | 39 -- .../remove_extra_button_from_email_digest.py | 25 - .../remove_old_cp_email_settings.py | 32 -- .../remove_page_break_from_defaults.py | 20 - .../remove_previous_field_property_setter.py | 23 - patches/before_jan_2012/repost_account_bal.py | 36 -- patches/before_jan_2012/repost_stock.py | 40 -- patches/before_jan_2012/sal_man_patch.py | 25 - .../task_email_notification.py | 21 - patches/before_jan_2012/update_0_idx.py | 26 -- .../update_gle_against_voucher_for_jv.py | 32 -- patches/jan_mar_2012/__init__.py | 1 - patches/jan_mar_2012/account_type_patch.py | 26 -- patches/jan_mar_2012/add_roles_to_admin.py | 11 - patches/jan_mar_2012/allocated_to_profile.py | 37 -- patches/jan_mar_2012/apps/__init__.py | 1 - patches/jan_mar_2012/apps/todo_item.py | 23 - .../jan_mar_2012/cancel_purchase_returned.py | 25 - patches/jan_mar_2012/clear_session_cache.py | 20 - .../jan_mar_2012/convert_tables_to_utf8.py | 28 -- .../customer_address_contact_patch.py | 75 --- patches/jan_mar_2012/delete_pur_of_service.py | 21 - patches/jan_mar_2012/deploy_packing_slip.py | 65 --- patches/jan_mar_2012/doclabel_in_doclayer.py | 29 -- patches/jan_mar_2012/dt_map_fix.py | 8 - patches/jan_mar_2012/email_settings_reload.py | 30 -- patches/jan_mar_2012/fix_packing_slip.py | 37 -- .../jan_mar_2012/jan_production_patches.py | 44 -- patches/jan_mar_2012/label_cleanup.py | 38 -- patches/jan_mar_2012/map_conversion_rate.py | 68 --- patches/jan_mar_2012/mapper_fix.py | 4 - patches/jan_mar_2012/navupdate.py | 60 --- patches/jan_mar_2012/no_copy_patch.py | 20 - patches/jan_mar_2012/pending_patches.py | 67 --- patches/jan_mar_2012/pos_setting_patch.py | 23 - patches/jan_mar_2012/print_hide_totals.py | 37 -- patches/jan_mar_2012/production_cleanup.py | 86 ---- patches/jan_mar_2012/reload_doctype.py | 21 - patches/jan_mar_2012/reload_item.py | 23 - patches/jan_mar_2012/reload_mapper.py | 10 - patches/jan_mar_2012/reload_po_pr_mapper.py | 21 - patches/jan_mar_2012/reload_quote.py | 5 - patches/jan_mar_2012/reload_table.py | 4 - patches/jan_mar_2012/remove_archive.py | 41 -- patches/jan_mar_2012/remove_get_tds_button.py | 31 -- patches/jan_mar_2012/remove_series_defval.py | 4 - patches/jan_mar_2012/rename_dt.py | 436 ------------------ patches/jan_mar_2012/serial_no_add_opt.py | 35 -- .../stable_branch_shift_09_01_12.py | 55 --- .../jan_mar_2012/stock_entry_others_patch.py | 7 - patches/jan_mar_2012/subcon_default_val.py | 24 - patches/jan_mar_2012/sync_ref_db.py | 54 --- patches/jan_mar_2012/update_purpose_se.py | 4 - patches/jan_mar_2012/update_se_fld_options.py | 7 - patches/jan_mar_2012/update_stockreco_perm.py | 4 - patches/jan_mar_2012/website/__init__.py | 3 - patches/jan_mar_2012/website/all.py | 36 -- .../website/allow_product_delete.py | 25 - patches/jan_mar_2012/website/analytics.py | 22 - patches/jan_mar_2012/website/cleanups.py | 48 -- patches/jan_mar_2012/website/domain_list.py | 39 -- patches/jan_mar_2012/website/feed.py | 22 - .../jan_mar_2012/website/file_data_rename.py | 81 ---- .../jan_mar_2012/website/getfile_rename.py | 67 --- patches/jan_mar_2012/website/login.py | 36 -- patches/jan_mar_2012/website/website.py | 89 ---- patches/patch_list.py | 207 --------- production/__init__.py | 4 +- production/doctype/bom/bom.txt | 12 +- .../doctype/bom_control/bom_control.txt | 4 +- .../bom_explosion_item/bom_explosion_item.txt | 4 +- production/doctype/bom_item/bom_item.txt | 4 +- .../doctype/bom_operation/bom_operation.txt | 4 +- .../production_control/production_control.txt | 2 +- .../production_order/production_order.txt | 8 +- .../production_plan_item.txt | 4 +- .../production_plan_sales_order.txt | 4 +- .../production_planning_tool.txt | 8 +- .../doctype/workstation/workstation.txt | 12 +- .../page/production_home/production_home.js | 4 +- .../page/production_home/production_home.txt | 10 +- .../consumption_against_production.txt | 4 +- .../itemwise_production_report.txt | 4 +- .../production_orders_in_process.txt | 4 +- public/js/modules.js | 4 +- .../doctype/features_setup/features_setup.txt | 4 +- setup/doctype/setup_control/setup_control.py | 2 +- setup/page/modules_setup/modules_setup.js | 2 +- stock/doctype/stock_entry/stock_entry.txt | 14 +- 124 files changed, 67 insertions(+), 4210 deletions(-) delete mode 100644 patches/before_jan_2012/Discount_purchase_cycle.py delete mode 100644 patches/before_jan_2012/__init__.py delete mode 100644 patches/before_jan_2012/accounts_default_form.py delete mode 100644 patches/before_jan_2012/auto_indent.py delete mode 100644 patches/before_jan_2012/c_form_patch.py delete mode 100644 patches/before_jan_2012/delivery_billing_status_patch.py delete mode 100644 patches/before_jan_2012/deploy_email_digest.py delete mode 100644 patches/before_jan_2012/edigest_enable_income_year_to_date.py delete mode 100644 patches/before_jan_2012/erpnext_structure_cleanup.py delete mode 100644 patches/before_jan_2012/index_patch.py delete mode 100644 patches/before_jan_2012/install_print_formats.py delete mode 100644 patches/before_jan_2012/lcw_patch.py delete mode 100644 patches/before_jan_2012/p1.py delete mode 100644 patches/before_jan_2012/packing_slip.py delete mode 100644 patches/before_jan_2012/price_list_patch.py delete mode 100644 patches/before_jan_2012/print_hide_price_list.py delete mode 100644 patches/before_jan_2012/profile_mark_not_in_create.py delete mode 100644 patches/before_jan_2012/project_patch.py delete mode 100644 patches/before_jan_2012/reload_address.py delete mode 100644 patches/before_jan_2012/reload_bom.py delete mode 100644 patches/before_jan_2012/reload_doclayer.py delete mode 100644 patches/before_jan_2012/reload_email_digest.py delete mode 100644 patches/before_jan_2012/reload_employeewise_balance_leave_report.py delete mode 100644 patches/before_jan_2012/reload_flat_bom.py delete mode 100644 patches/before_jan_2012/reload_gl_mapper.py delete mode 100644 patches/before_jan_2012/reload_lc_wizard.py delete mode 100644 patches/before_jan_2012/reload_print_format.py delete mode 100644 patches/before_jan_2012/reload_project_task.py delete mode 100644 patches/before_jan_2012/reload_reco.py delete mode 100644 patches/before_jan_2012/reload_rv.py delete mode 100644 patches/before_jan_2012/reload_support_ticket.py delete mode 100644 patches/before_jan_2012/remove_duplicate_table_mapper_detail.py delete mode 100644 patches/before_jan_2012/remove_extra_button_from_email_digest.py delete mode 100644 patches/before_jan_2012/remove_old_cp_email_settings.py delete mode 100644 patches/before_jan_2012/remove_page_break_from_defaults.py delete mode 100644 patches/before_jan_2012/remove_previous_field_property_setter.py delete mode 100644 patches/before_jan_2012/repost_account_bal.py delete mode 100644 patches/before_jan_2012/repost_stock.py delete mode 100644 patches/before_jan_2012/sal_man_patch.py delete mode 100644 patches/before_jan_2012/task_email_notification.py delete mode 100644 patches/before_jan_2012/update_0_idx.py delete mode 100644 patches/before_jan_2012/update_gle_against_voucher_for_jv.py delete mode 100644 patches/jan_mar_2012/__init__.py delete mode 100644 patches/jan_mar_2012/account_type_patch.py delete mode 100644 patches/jan_mar_2012/add_roles_to_admin.py delete mode 100644 patches/jan_mar_2012/allocated_to_profile.py delete mode 100644 patches/jan_mar_2012/apps/__init__.py delete mode 100644 patches/jan_mar_2012/apps/todo_item.py delete mode 100644 patches/jan_mar_2012/cancel_purchase_returned.py delete mode 100644 patches/jan_mar_2012/clear_session_cache.py delete mode 100644 patches/jan_mar_2012/convert_tables_to_utf8.py delete mode 100644 patches/jan_mar_2012/customer_address_contact_patch.py delete mode 100644 patches/jan_mar_2012/delete_pur_of_service.py delete mode 100644 patches/jan_mar_2012/deploy_packing_slip.py delete mode 100644 patches/jan_mar_2012/doclabel_in_doclayer.py delete mode 100644 patches/jan_mar_2012/dt_map_fix.py delete mode 100644 patches/jan_mar_2012/email_settings_reload.py delete mode 100644 patches/jan_mar_2012/fix_packing_slip.py delete mode 100644 patches/jan_mar_2012/jan_production_patches.py delete mode 100644 patches/jan_mar_2012/label_cleanup.py delete mode 100644 patches/jan_mar_2012/map_conversion_rate.py delete mode 100644 patches/jan_mar_2012/mapper_fix.py delete mode 100644 patches/jan_mar_2012/navupdate.py delete mode 100644 patches/jan_mar_2012/no_copy_patch.py delete mode 100644 patches/jan_mar_2012/pending_patches.py delete mode 100644 patches/jan_mar_2012/pos_setting_patch.py delete mode 100644 patches/jan_mar_2012/print_hide_totals.py delete mode 100644 patches/jan_mar_2012/production_cleanup.py delete mode 100644 patches/jan_mar_2012/reload_doctype.py delete mode 100644 patches/jan_mar_2012/reload_item.py delete mode 100644 patches/jan_mar_2012/reload_mapper.py delete mode 100644 patches/jan_mar_2012/reload_po_pr_mapper.py delete mode 100644 patches/jan_mar_2012/reload_quote.py delete mode 100644 patches/jan_mar_2012/reload_table.py delete mode 100644 patches/jan_mar_2012/remove_archive.py delete mode 100644 patches/jan_mar_2012/remove_get_tds_button.py delete mode 100644 patches/jan_mar_2012/remove_series_defval.py delete mode 100644 patches/jan_mar_2012/rename_dt.py delete mode 100644 patches/jan_mar_2012/serial_no_add_opt.py delete mode 100644 patches/jan_mar_2012/stable_branch_shift_09_01_12.py delete mode 100644 patches/jan_mar_2012/stock_entry_others_patch.py delete mode 100644 patches/jan_mar_2012/subcon_default_val.py delete mode 100644 patches/jan_mar_2012/sync_ref_db.py delete mode 100644 patches/jan_mar_2012/update_purpose_se.py delete mode 100644 patches/jan_mar_2012/update_se_fld_options.py delete mode 100644 patches/jan_mar_2012/update_stockreco_perm.py delete mode 100644 patches/jan_mar_2012/website/__init__.py delete mode 100644 patches/jan_mar_2012/website/all.py delete mode 100644 patches/jan_mar_2012/website/allow_product_delete.py delete mode 100644 patches/jan_mar_2012/website/analytics.py delete mode 100644 patches/jan_mar_2012/website/cleanups.py delete mode 100644 patches/jan_mar_2012/website/domain_list.py delete mode 100644 patches/jan_mar_2012/website/feed.py delete mode 100644 patches/jan_mar_2012/website/file_data_rename.py delete mode 100644 patches/jan_mar_2012/website/getfile_rename.py delete mode 100644 patches/jan_mar_2012/website/login.py delete mode 100644 patches/jan_mar_2012/website/website.py diff --git a/buying/doctype/supplier_quotation/supplier_quotation.txt b/buying/doctype/supplier_quotation/supplier_quotation.txt index 587478b66f..4e40539382 100644 --- a/buying/doctype/supplier_quotation/supplier_quotation.txt +++ b/buying/doctype/supplier_quotation/supplier_quotation.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-08-06 11:15:46", "modified_by": "Administrator", - "modified": "2012-08-02 18:04:35" + "modified": "2012-12-10 18:30:00" }, { "is_submittable": 1, @@ -698,7 +698,7 @@ "doctype": "DocPerm", "submit": 1, "write": 1, - "role": "Production Manager", + "role": "Manufacturing Manager", "cancel": 1, "permlevel": 0 }, diff --git a/home/doctype/home_control/home_control.py b/home/doctype/home_control/home_control.py index 75ab2222ce..3b7ae3242f 100644 --- a/home/doctype/home_control/home_control.py +++ b/home/doctype/home_control/home_control.py @@ -265,7 +265,7 @@ class DocType: # module settings # ------------------------------------------------------------------------------------------------------- def get_module_order(self): - show_list = ['Home','Setup','Accounts','Selling','Buying','Support','Stock','HR','Projects','Analysis','Production'] + show_list = ['Home','Setup','Accounts','Selling','Buying','Support','Stock','HR','Projects','Analysis','Manufacturing'] ml = filter(lambda x: x[0] in show_list, \ sql("select name, module_label, module_seq, is_hidden from `tabModule Def` where docstatus<2 order by module_seq asc, module_label asc")) return webnotes.conn.convert_to_lists(ml) diff --git a/home/page/desktop/desktop.css b/home/page/desktop/desktop.css index f1c4fb0918..88a437c622 100644 --- a/home/page/desktop/desktop.css +++ b/home/page/desktop/desktop.css @@ -6,7 +6,7 @@ .sprite-hr{ background-position: 0 -439px; width: 40px; height: 32px; } .sprite-kb{ background-position: 0 -521px; width: 24px; height: 39px; } .sprite-messages{ background-position: 0 -610px; width: 40px; height: 26px; } -.sprite-production{ background-position: 0 -686px; width: 40px; height: 33px; } +.sprite-manufacturing{ background-position: 0 -686px; width: 40px; height: 33px; } .sprite-project{ background-position: 0 -769px; width: 40px; height: 22px; } .sprite-report{ background-position: 0 -841px; width: 29px; height: 40px; } .sprite-selling{ background-position: 0 -931px; width: 34px; height: 40px; } @@ -26,7 +26,7 @@ .sprite-support{ margin-top: 8px; margin-left: 8px; } .sprite-hr{ margin-top: 12px; margin-left: 8px; } .sprite-project{ margin-top: 16px; margin-left: 8px; } -.sprite-production{ margin-top: 10px; margin-left: 8px; } +.sprite-manufacturing{ margin-top: 10px; margin-left: 8px; } .sprite-website{ margin-top: 8px; margin-left: 8px; } .sprite-setting{ margin-top: 8px; margin-left: 8px; } .sprite-report{ margin-top: 8px; margin-left: 14px; } diff --git a/home/page/desktop/desktop.js b/home/page/desktop/desktop.js index 75f2922b93..f9a3b544a2 100644 --- a/home/page/desktop/desktop.js +++ b/home/page/desktop/desktop.js @@ -33,7 +33,7 @@ erpnext.desktop.render = function() { 'Support': { sprite: 'support', label: 'Support'}, 'HR': { sprite: 'hr', label: 'Human
Resources'}, 'Projects': { sprite: 'project', label: 'Projects'}, - 'Production': { sprite: 'production', label: 'Production'}, + 'Manufacturing': { sprite: 'manufacturing', label: 'Manufacturing'}, 'Website': { sprite: 'website', label: 'Website'}, 'Activity': { sprite: 'feed', label: 'Activity'}, 'Setup': { sprite: 'setting', label: 'Setup'}, diff --git a/patches/before_jan_2012/Discount_purchase_cycle.py b/patches/before_jan_2012/Discount_purchase_cycle.py deleted file mode 100644 index 8ddcbf5967..0000000000 --- a/patches/before_jan_2012/Discount_purchase_cycle.py +++ /dev/null @@ -1,31 +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(): - import webnotes - from webnotes.modules import reload_doc - - reload_doc('accounts', 'doctype', 'pv_detail') - reload_doc('buying', 'doctype', 'po_detail') - reload_doc('stock', 'doctype', 'purchase_receipt_detail') - if webnotes.conn.sql("select name from `tabDocField` where parent = 'Purchase Order Item' and fieldname = 'discount'"): - webnotes.conn.sql("update `tabPurchase Order Item` set discount_rate=discount") - - # Features setup - reload_doc('setup', 'doctype', 'features_setup') - from webnotes.model.code import get_obj - get_obj('Features Setup').validate() diff --git a/patches/before_jan_2012/__init__.py b/patches/before_jan_2012/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/patches/before_jan_2012/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/patches/before_jan_2012/accounts_default_form.py b/patches/before_jan_2012/accounts_default_form.py deleted file mode 100644 index 51e41aa0cb..0000000000 --- a/patches/before_jan_2012/accounts_default_form.py +++ /dev/null @@ -1,23 +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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('setup', 'doctype', 'company') - reload_doc('setup', 'doctype', 'manage_account') - diff --git a/patches/before_jan_2012/auto_indent.py b/patches/before_jan_2012/auto_indent.py deleted file mode 100644 index 6018681a0b..0000000000 --- a/patches/before_jan_2012/auto_indent.py +++ /dev/null @@ -1,25 +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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('setup', 'doctype', 'manage_account') - reload_doc('stock', 'doctype', 'item') - webnotes.conn.sql("delete from `tabDocField` where fieldname='minimum_inventory_level' and parent='item'") - webnotes.conn.sql("update `tabItem` set re_order_level = minimum_inventory_level where ifnull(re_order_level,0) = 0 ") - diff --git a/patches/before_jan_2012/c_form_patch.py b/patches/before_jan_2012/c_form_patch.py deleted file mode 100644 index 37b99835a5..0000000000 --- a/patches/before_jan_2012/c_form_patch.py +++ /dev/null @@ -1,29 +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(): - import webnotes - from webnotes.modules import reload_doc - - reload_doc('accounts', 'doctype', 'receivable_voucher') - reload_doc('accounts', 'doctype', 'c_form') - reload_doc('accounts', 'doctype', 'c_form_invoice_detail') - reload_doc('accounts', 'Module Def', 'Accounts') - - sql = webnotes.conn.sql - sql("update `tabSales Invoice` set c_form_applicable = 'Yes' where c_form_applicable = 'Y'") - sql("update `tabSales Invoice` set c_form_applicable = 'No' where c_form_applicable = 'N'") diff --git a/patches/before_jan_2012/delivery_billing_status_patch.py b/patches/before_jan_2012/delivery_billing_status_patch.py deleted file mode 100644 index ca022f3a47..0000000000 --- a/patches/before_jan_2012/delivery_billing_status_patch.py +++ /dev/null @@ -1,72 +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 -import webnotes -sql = webnotes.conn.sql - -test=1 - -# Update SO and DN Detail -#-------------------------- -def update_delivered_billed_qty(): - # update billed amt in item table in so and dn - sql(""" update `tabSales Order Item` so - set billed_amt = (select sum(amount) from `tabSales Invoice Item` where `so_detail`= so.name and docstatus=1 and parent not like 'old%%'), - delivered_qty = (select sum(qty) from `tabDelivery Note Item` where `prevdoc_detail_docname`= so.name and docstatus=1 and parent not like 'old%%'), - modified = now() - where docstatus = 1 - """) - - sql(""" update `tabDelivery Note Item` dn - set billed_amt = (select sum(amount) from `tabSales Invoice Item` where `dn_detail`= dn.name and docstatus=1 and parent not like 'old%%'), - modified = now() - where docstatus = 1 - """) - -# update SO -#--------------- -def update_percent(): - # calculate % billed based on item table - sql(""" update `tabSales Order` so - set per_delivered = (select sum(if(qty > ifnull(delivered_qty, 0), delivered_qty, qty))/sum(qty)*100 from `tabSales Order Item` where parent=so.name), - per_billed = (select sum(if(amount > ifnull(billed_amt, 0), billed_amt, amount))/sum(amount)*100 from `tabSales Order Item` where parent = so.name), - modified = now() - where docstatus = 1 - """) - - # update DN - # --------- - sql(""" update `tabDelivery Note` dn - set per_billed = (select sum(if(amount > ifnull(billed_amt, 0), billed_amt, amount))/sum(amount)*100 from `tabDelivery Note Item` where parent = dn.name), - modified = now() - where docstatus=1 - """) - -# update delivery/billing status -#------------------------------- -def update_status(): - sql("""update `tabSales Order` set delivery_status = if(ifnull(per_delivered,0) < 0.001, 'Not Delivered', - if(per_delivered >= 99.99, 'Fully Delivered', 'Partly Delivered'))""") - sql("""update `tabSales Order` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', - if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""") - sql("""update `tabDelivery Note` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', - if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""") - -def execute(): - update_delivered_billed_qty() - update_percent() - update_status() diff --git a/patches/before_jan_2012/deploy_email_digest.py b/patches/before_jan_2012/deploy_email_digest.py deleted file mode 100644 index 238ff00a3b..0000000000 --- a/patches/before_jan_2012/deploy_email_digest.py +++ /dev/null @@ -1,113 +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 -import webnotes - -def execute(): - """ - * Reload email_digest doctype - * Create default email digest - """ - from webnotes.modules import reload_doc - - # Minor fix in print_format doctype - #reload_doc('core', 'doctype', 'print_format') - - #reload_doc('setup', 'doctype', 'email_digest') - - #global create_default_email_digest - #create_default_email_digest() - - global enabled_default_email_digest - enabled_default_email_digest() - - -def enabled_default_email_digest(): - """ - Enables the created email digest - """ - from webnotes.model.doc import Document - from webnotes.model.code import get_obj - companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1) - for company in companies_list: - if company and company[0]: - edigest = Document('Email Digest', 'Default Weekly Digest - ' + company[0]) - if edigest: - edigest.enabled = 1 - edigest.save() - ed_obj = get_obj(doc=edigest) - ed_obj.on_update() - - - -def create_default_email_digest(): - """ - * Weekly Digest - * For all companies - * Recipients: System Managers - * Full content - * Disabled by default - """ - from webnotes.model.doc import Document - companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1) - global get_system_managers - system_managers = get_system_managers() - for company in companies_list: - if company and company[0]: - edigest = Document('Email Digest') - edigest.name = "Default Weekly Digest - " + company[0] - edigest.company = company[0] - edigest.frequency = 'Weekly' - edigest.recipient_list = system_managers - edigest.new_leads = 1 - edigest.new_enquiries = 1 - edigest.new_quotations = 1 - edigest.new_sales_orders = 1 - edigest.new_purchase_orders = 1 - edigest.new_transactions = 1 - edigest.payables = 1 - edigest.payments = 1 - edigest.expenses_booked = 1 - edigest.invoiced_amount = 1 - edigest.collections = 1 - edigest.income = 1 - edigest.bank_balance = 1 - exists = webnotes.conn.sql("""\ - SELECT name FROM `tabEmail Digest` - WHERE name = %s""", edigest.name) - if (exists and exists[0]) and exists[0][0]: - continue - else: - edigest.save(1) - - -def get_system_managers(): - """ - Returns a string of system managers' email addresses separated by \n - """ - system_managers_list = webnotes.conn.sql("""\ - SELECT DISTINCT p.name - FROM tabUserRole ur, tabProfile p - WHERE - ur.parent = p.name AND - ur.role='System Manager' AND - p.docstatus<2 AND - p.enabled=1 AND - p.name not in ('Administrator', 'Guest')""", as_list=1) - - return "\n".join([sysman[0] for sysman in system_managers_list]) - diff --git a/patches/before_jan_2012/edigest_enable_income_year_to_date.py b/patches/before_jan_2012/edigest_enable_income_year_to_date.py deleted file mode 100644 index 0403e01bc8..0000000000 --- a/patches/before_jan_2012/edigest_enable_income_year_to_date.py +++ /dev/null @@ -1,28 +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 -import webnotes -from webnotes.model.doc import Document - -def execute(): - companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1) - for company in companies_list: - if company and company[0]: - edigest = Document('Email Digest', "Default Weekly Digest - " + company[0]) - if edigest: - edigest.income_year_to_date = 1 - edigest.save() diff --git a/patches/before_jan_2012/erpnext_structure_cleanup.py b/patches/before_jan_2012/erpnext_structure_cleanup.py deleted file mode 100644 index 6e58b18d21..0000000000 --- a/patches/before_jan_2012/erpnext_structure_cleanup.py +++ /dev/null @@ -1,217 +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 . - -#Cleanup all unwanted documents and restructure of moduloes -#---------------------------------------------------------- - -from __future__ import unicode_literals -import webnotes -from webnotes.model import delete_doc -from webnotes.modules import reload_doc -from webnotes.modules.export_file import export_to_files -sql = webnotes.conn.sql - - -#---------------------------- - -def delete_unwanted_doctypes(): - "deletes doctypes which are not used anymore" - - try: - sql("delete from `tabMenu Item`") - sql("delete from tabDocField where fieldname = 'site_map_details' and parent ='Control Panel'") - except: - pass - - lst = ['Zone', 'WN Account Control', 'Wiki Page', 'Wiki History', 'Wiki Control', 'While You Were Out', 'Web Visitor', 'Tweet', 'Transfer Utility', 'Transfer Module', 'Transfer Control', 'Transfer Account', 'Tips Common', 'TestTabDT', 'TestDT', 'Test Type', 'Test Run', 'Test Record Detail', 'Test Record', 'Test Case', 'Supplier TDS Category Detail', 'Shopping Cart Control', 'Service Series', 'Series Detail', 'Rule Engine', 'RFQ', 'Report Filter Detail', 'Report Field Detail','Report Control', 'Rating Widget Record', 'Rating Widget Control', 'Rating Template Detail', 'Rating Template', 'PV Ded Tax Detail', 'PV Add Tax Detail', 'Product Variant', 'Product Variance', 'Product Group', 'Product Feature', 'Payroll Tips Common', 'Payroll Rule', 'Password Control', 'Page Visit', 'Patch', 'Multiple Transfer', 'Module Tip Control', 'Module Setter', 'Module Manager', 'Module Import', 'Module Detail', 'Message Control', 'Message', 'Mail Participant Details', 'Mail', 'Leave Type Detail', 'Leave Detail', 'Leave Applicable Detail', 'Lead Item Detail', 'Lead Attachment Detail', 'Item Attachments Detail', 'Instant Message', 'Impact Analysis', 'Forum Topic', 'Forum Control', 'Form Settings', 'Follower', 'ERP Setup', 'Enquiry Attachment Detail', 'Documentation', 'Condition Detail', 'Complaint Note', 'Code History', 'Code Editor', 'Code Backup Control', 'Code Backup', 'City', 'Change Log', 'Business Letter Type', 'Business Letter Template', 'Business Letter', 'Badge Settings Detail', 'Application Type', 'Application', 'Action Detail', 'Accounts Setup', 'Stock Common', 'Job Application', 'Service Schedule', 'Comment Control', 'Bank', 'Tag Widget Control', 'Feature Update', 'RFQ Detail', 'Supplier Quotation Detail', 'Supplier Quotation', 'Year Closing Voucher', 'Approval Structure', 'Site Map Detail', 'Menu Control', 'Menu Item', 'Menu Item Role'] # bank - for d in lst: - try: - sql("delete from `tabProperty Setter` where select_doctype = '%s'" % d) - sql("delete from `tabCustom Script` where dt = '%s'" % d) - sql("delete from `tabCustom Field` where dt = '%s'" % d) - delete_doc('DocType', d) - except: - pass - - - sql("commit") - delete_tables(lst) - -def delete_tables(lst): - for d in lst: - for t in ['tab', 'arc']: - try: - sql("drop table `%s%s`" % (t, d)) - except: - continue - -def delete_unwanted_pages(): - "deletes pages which are not used anymore" - lst = ['Transaction Authorization', 'Prduct Display', 'Data Import', 'Partner Home', 'Product Display', 'Module Settings', 'About Us', 'Custom Reports', 'MIS', 'MIS - Comparison Report', 'Monthly MIS', 'MyReports', 'Navigation Page', 'Point Race', 'Tag Widget', 'Widget Test', 'Yearly MIS'] - for d in lst: - try: - delete_doc('Page', d) - except: - pass - - -def delete_unwanted_search_criteria(): - "deletes search criteria which are not used anymore" - - sql("update `tabSearch Criteria` set module = 'HR' where name = 'salary_structure_details'") - - lst = ['_SRCH00002', '_SRCH00001', 'warranty-amc_summary1', 'test_so4', 'test_so3', 'test_so2', 'test_so1', 'test_so', 'test5', 'target_variance_report1', 'STDSRCH/00006', 'STDSRCH/00005', 'STDSRCH/00004', 'STDSRCH/00003', 'STDSRCH/00002', 'STDSRCH/00001', 'so_pending_items_6', 'so_pending_items_5', 'so_pending_items_3', 'so_pending_items_34', 'scrap', 'sales_report_test', 'salary_structure_details1', 'salary_structure_details2', 'salary_structure_details3', 'salary_slips1', 'projectwise_pending_qty_and_costs2', 'projectwise_pending_qty_and_costs1', 'projectwise_delivered_qty_and_costs1', 'projectwise_delivered_qty_and_costs2', 'New Search Criteria 1', 'monthly_salary_register2', 'monthly_salary_register1', 'installed_items','follow_up_history', 'follow_up_report', 'employee_in_company_experience2', 'employee_in_company_experience1', 'employee_in_company_experience', 'employee_details', 'employee_details1', 'employee_details2', 'employees_birthday1', 'draft_so_pending_items', 'draft_sales_orders', 'delivery_notewise_pending_qty_to_install', 'datewise_leave_report2', 'datewise_leave_report1', 'datewise_leave_report', 'customer_issues1', 'cancelled_so_pending_items1', 'cancelled_so_pending_items', 'budget_variance_report3', 'budget_variance_report1', 'account_-_inputs_rg_23_a_-_part_ii_wrong_one', 'territory_item_group_wise_gp', 'sales_orderwise_pending_packing_item_summary', 'itemwise_trend', 'monthly_attendance_details_old', 'projectwise_contribution_report', 'projectwise_delivery_and_material_cost', 'projectwise_delivery_and_mat_cost_report', 'territorywise_trend', 'test_dn', 'rfq', 'rfq1'] - - for d in lst: - if sql("select name from `tabSearch Criteria` where ifnull(standard, 'Yes') = 'Yes' and name = '%s'" % d): - try: - delete_doc('Search Criteria', d) - except: - pass - - -def delete_unwanted_mappers(): - "deletes unwanted mappers" - - lst = ['Customer Issue-Maintenance Report', 'Enquiry-Service Quotation', 'Sales Order-Maintenance Report', 'Service Quotation-Service Order', 'Supplier Quotation-Purchase Order', 'Visit Schedule-Maintenance Report', 'RFQ-Supplier Quotation', 'Purchase Request-RFQ'] - for d in lst: - try: - delete_doc('DocType Mapper', d) - except: - pass - -def delete_unwanted_modules(): - "deletes unwanted modules" - lst = ['Development', 'Recycle Bin', 'Testing', 'Testing System', 'Test', 'Partner Updates', 'My Company', 'Event Updates', 'E-Commerce'] - for d in lst: - try: - delete_doc('Module Def', d) - except: - pass - -#--------------------------------------------- - -def rename_merge_modules(): - "Rename module as per users view and merge for removing confusion" - - rename_lst = [['CRM', 'Selling'], ['SRM','Buying'], ['Material Management', 'Stock'], ['Payroll','HR'], ['Maintenance', 'Support']] - for d in rename_lst: - # create new module manually and export to file??????? - reload_doc(d[1].lower(), 'Module Def', d[1]) - - merge_lst = [['Tools', 'Utilities'], ['Application Internal', 'Utilities'], ['Settings', 'Setup']] - # settings hardcoded in my_company - # module hardcoded in home_control - # material_management hardcoded in installation note - # maintenance hardcoded in support_email_settings - - lst = rename_lst + merge_lst - for d in lst: - update_module(d[0], d[1]) - try: - delete_doc('Module Def', d[0]) - except: - pass - reload_doc('Utilities', 'Module Def', 'Utilities') - -def update_module(from_mod, to_mod): - for t in ['DocType', 'Page', 'Search Criteria', 'DocType Mapper', 'Print Format', 'Role']: - sql("update `tab%s` set module='%s' where module = '%s'"% (t, to_mod, from_mod)) - -#------------------------------------ -def sync_roles(): - "Put Roles into corresponding module and delete Roles module" - - # roles - roles = { - 'Accounts' : "'Accounts Manager', 'Accounts User', 'Auditor'", - 'Selling' : "'Customer', 'Sales User', 'Sales Manager', 'Sales Master Manager', 'Partner'", - 'Buying' : "'Supplier', 'Purchase User', 'Purchase Manager', 'Purchase Master Manager'", - 'Stock' : "'Material User', 'Material Master Manager', 'Material Manager', 'Quality Manager'", - 'Support' : "'Support Team', 'Support Manager', 'Maintenance User', 'Maintenance Manager'", - 'Production': "'Production User', 'Production Manager', 'Production Master Manager'", - 'Setup' : "'System Manager'", - 'Projects' : "'Projects User'", - 'HR' : "'HR User', 'HR Manager', 'Employee'", - 'Core' : "'Administrator', 'All', 'Guest'" - } - for mod in roles.keys(): - sql("update `tabRole` set module = '%s' where name in (%s)" % (mod, roles[mod])) - - sql("update `tabDocType` set module = 'Setup' where name = 'Role'") - try: - - delete_doc('Module Def', 'Roles') - except: - pass -#------------------------------------ -def sync_mapper(): - "Put mappers into corresponding module" - - mappers = { - 'Accounts': ('Delivery Note-Sales Invoice', 'Project-Sales Invoice', 'Purchase Order-Purchase Invoice', 'Purchase Receipt-Purchase Invoice', 'Sales Order-Sales Invoice'), - 'Selling': ('Delivery Note-Installation Note', 'Opportunity-Quotation', 'Lead-Opportunity', 'Lead-Customer', 'Project-Sales Order', 'Quotation-Sales Order', ), - 'Buying': ('Purchase Request-Purchase Order', 'Sales Order-Purchase Request'), - 'Stock': ('Purchase Order-Purchase Receipt', 'Project-Delivery Note', 'Sales Invoice-Delivery Note', 'Sales Order-Delivery Note'), - 'Support': ('Customer Issue-Maintenance Visit', 'Sales Order-Maintenance Schedule', 'Sales Order-Maintenance Visit'), - 'Production': ('Production Forecast-Production Plan', 'Production Forecast-Production Planning Tool', 'Sales Order-Production Plan'), - 'HR': ('Appraisal Template-Appraisal', 'Salary Structure-Salary Slip') - } - - for mod in mappers.keys(): - sql("update `tabDocType Mapper` set module = '%s' where name in %s" % (mod, mappers[mod])) - try: - delete_doc('Module Def', 'Mapper') - except: - pass -# -------------------------------------- -# function below will be run only in localhost -'''def export_docs(): - """ - Export all documents where module has been changed - """ - for dtype in ['DocType', 'Page', 'Search Criteria', 'DocType Mapper', 'Print Format', 'Role']: - lst = sql("select name, module from `tab%s`" % dtype) - for rec in lst: - webnotes.msgprint(rec) - if rec and rec[0] and rec[1]: - export_to_files(record_list = [[dtype, rec[0]]], record_module = rec[1]) - - #grep test company -''' - -#--------------------------------------- -def run_patches(): - # update module - dt_module = {'Landed Cost Purchase Receipt':'Stock', 'Landed Cost Item':'Stock', 'Comment': 'Core', 'Tag':'Core', 'Tag Detail': 'Core', 'POS Settings': 'Accounts', 'Menu Item': 'Setup', 'Menu Item Role': 'Setup'} - for d in dt_module.keys(): - sql("update `tabDocType` set module = '%s' where name = '%s'" % (dt_module[d], d)) - delete_unwanted_mappers() - delete_unwanted_doctypes() - sql("start transaction") - delete_unwanted_pages() - - delete_unwanted_search_criteria() - - - rename_merge_modules() - sync_roles() - sync_mapper() - delete_unwanted_modules() - # landed cost wizard link in stock - reload_doc('stock', 'Module Def', 'Stock') - - sql("commit") diff --git a/patches/before_jan_2012/index_patch.py b/patches/before_jan_2012/index_patch.py deleted file mode 100644 index 7971fbf2b4..0000000000 --- a/patches/before_jan_2012/index_patch.py +++ /dev/null @@ -1,311 +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 -""" - This patch removes wrong indexs and add proper indexes in tables -""" - -import webnotes -sql = webnotes.conn.sql -from webnotes.utils import cstr - -def create_proper_index(): - from webnotes.modules.export_file import export_to_files - - dt_index_fields={ - 'Purchase Receipt Item': ['prevdoc_docname', 'item_code', 'warehouse', 'prevdoc_detail_docname'], - 'Period Closing Voucher': ['closing_account_head', 'fiscal_year'], - 'Lead': ['lead_name', 'status', 'transaction_date'], - 'Time Sheet Detail': ['app_name'], - 'Item Quality Inspection Parameter': [], - 'Budget Detail': ['fiscal_year', 'account'], - 'Grade': [], - 'Sales Taxes and Charges': ['parenttype', 'account_head'], - 'TDS Category Account': ['account_head'], - 'Role': [], - 'Leave Allocation': ['leave_type', 'employee', 'fiscal_year'], - 'Branch': [], - 'Department': [], - 'Contact Detail': [], - 'Territory': ['lft', 'rgt', 'parent_territory'], - 'Item Tax': ['tax_type'], - 'Bin': ['warehouse', 'item_code'], - 'PPW Detail': ['warehouse'], - 'Sales Partner': ['partner_name'], - 'Default Home Page': ['home_page', 'role'], - 'Custom Field': ['dt'], - 'DocFormat': ['format'], - 'DocType Mapper': ['from_doctype', 'to_doctype'], - 'Brand': [], - 'Quotation Lost Reason': [], - 'Journal Voucher': ['posting_date', 'voucher_type'], - 'TDS Return Acknowledgement': ['date_of_receipt', 'acknowledgement'], - 'BOM Report Detail': ['item_code'], - 'Quotation Item': ['item_code'], - 'Update Delivery Date Detail': ['sales_order_no'], - 'Sales Invoice Advance': ['journal_voucher'], - 'Authorization Rule': ['approving_user', 'system_user', 'system_role', 'approving_role'], - 'DocPerm': ['permlevel', 'role'], - 'Stock Entry Detail': ['item_code', 't_warehouse', 's_warehouse'], - 'Stock Entry': ['posting_date', 'delivery_note_no', 'purchase_receipt_no', 'production_order'], - 'Price List': [], - 'Appraisal Template Goal': [], - 'Production Order': ['status', 'project_name', 'production_item'], - 'Account': ['lft', 'rgt', 'parent_account'], - 'Earn Deduction Detail': [], - 'Purchase Request': ['status', 'transaction_date'], - 'Tag Detail': [], - 'Salary Slip Deduction': ['d_type'], - 'Batch': ['item'], - 'Deduction Type': [], - 'Project': ['project_name', 'customer'], - 'UserRole': ['role'], - 'DocField': ['label', 'fieldtype', 'fieldname'], - 'Property Setter': ['doc_type', 'doc_name', 'property'], - 'Appraisal': ['status', 'employee'], - 'Letter Head': [], - 'Communication Log': ['follow_up_by'], - 'Project Cost Breakup': [], - 'Table Mapper Detail': [], - 'Campaign': [], - 'SMS Parameter': [], - 'Leave Type': [], - 'Absent Days Detail': [], - 'Tag': [], - 'Raw Materials Supplied': ['raw_material'], - 'Project Activity Update': [], - 'Purchase Receipt Item Supplied': [], - 'Bank Reconciliation Detail': ['voucher_id'], - 'Sales Order': ['quotation_no', 'project_name', 'customer', 'posting_date'], - 'Chapter VI A Detail': [], - 'Employee Internal Work History': [], - 'Order Reconciliation Detail': ['sales_order_no'], - 'Attendance': ['employee', 'att_date'], - 'Employee External Work History': [], - 'Salary Structure Earning': ['e_type'], - 'Sales Order Item': ['item_code', 'prevdoc_docname', 'reserved_warehouse'], - 'Appraisal Template': [], - 'Budget Distribution': ['fiscal_year'], - 'Workstation': ['warehouse'], - 'Training Session Details': [], - 'Sales Taxes and Charges Master': [], - 'State': [], - 'Bulk Rename Tool': [], - 'Landed Cost Master Detail': [], - 'Employee': ['employee_name', 'designation', 'department'], - 'Terms And Conditions': [], - 'TC Detail': [], - 'UOM': [], - 'Supplier Type': [], - 'Project Milestone': [], - 'Landed Cost Master': [], - 'Budget Distribution Detail': [], - 'Form 16A Ack Detail': [], - 'Campaign Expense': [], - 'Time Sheet': ['employee_name', 'time_sheet_date'], - 'File Group': ['parent_group'], - 'Maintenance Visit Purpose': ['item_code', 'service_person'], - 'Support Ticket Response': [], - 'Purchase Invoice Item': ['item_code', 'purchase_order', 'po_detail', 'purchase_receipt', 'pr_detail', 'expense_head', 'cost_center'], - 'Timesheet Detail': ['project_name', 'task_id', 'customer_name'], - 'Holiday': [], - 'Workflow Rule Detail': [], - 'Module Def': ['module_seq', 'module_page'], - 'Terms and Conditions': [], - 'PF Detail': ['item_code'], - 'POS Setting': ['user', 'territory'], - 'Quality Inspection Reading': [], - 'Support Ticket': ['customer', 'allocated_to', 'status'], - 'Project Activity': ['project'], - 'Customer Group': ['lft', 'rgt', 'parent_customer_group'], - 'Sales and Purchase Return Item': ['item_code'], - 'Series Detail': [], - 'Event Role': ['role'], - 'Contact': ['employee_id'], - 'BOM Item': ['item_code', 'bom_no'], - 'Invest 80 Declaration Detail': [], - 'Purchase Order Item Supplied': [], - 'Industry Type': [], - 'Declaration Detail': [], - 'Holiday List': ['fiscal_year'], - 'Sales Person': ['lft', 'rgt', 'parent_sales_person'], - 'Sales Invoice Item': ['item_code', 'sales_order', 'so_detail', 'delivery_note', 'dn_detail', 'cost_center', 'income_account'], - 'Module Def Item': [], - 'TDS Category': [], - 'DocTrigger': [], - 'Print Format': ['standard'], - 'Installation Note Item': ['prevdoc_docname', 'item_code'], - 'Form 16A Tax Detail': [], - 'Event': ['event_date', 'event_type'], - 'Currency': [], - 'Warehouse Type': ['warehouse_type'], - 'Sales BOM': ['item_group'], - 'IT Checklist': ['employee'], - 'Purchase Taxes and Charges Master': [], - 'Company': [], - 'Call Log': [], - 'Employee Training': [], - 'Warehouse': ['warehouse_type'], - 'Competitor': [], - 'Mode of Payment': [], - 'Training Session': ['customer'], - 'Cost Center': ['lft', 'rgt', 'parent_cost_center'], - 'Timesheet': ['status', 'timesheet_date'], - 'Form 16A': ['party_no'], - 'Sales BOM Item': ['item_code'], - 'Answer': ['question'], - 'Supplier': [], - 'Installation Note': ['delivery_note_no', 'customer', 'inst_date'], - 'Expense Claim': ['approval_status', 'employee'], - 'Target Detail': ['from_date', 'to_date', 'fiscal_year'], - 'Page Role': ['role'], - 'Partner Target Detail': ['fiscal_year', 'item_group'], - 'Shipping Address': ['customer'], - 'Purchase Request Item': ['item_code', 'warehouse'], - 'TDS Payment Detail': [], - 'Market Segment': [], - 'Comment': [], - 'Service Order Detail': ['item_code', 'prevdoc_docname'], - 'TDS Payment': ['from_date', 'to_date', 'tds_category'], - 'Lead Email CC Detail': [], - 'User Setting-Role User': [], - 'Salary Slip': ['month', 'year', 'employee'], - 'Maintenance Schedule Detail': ['item_code', 'scheduled_date'], - 'Employment Type': [], - 'Purchase Invoice Advance': ['journal_voucher'], - 'Quotation': ['customer', 'transaction_date'], - 'Salary Structure Deduction': ['d_type'], - 'BOM': ['item', 'project_name'], - 'Earning Type': [], - 'Designation': [], - 'BOM Replace Utility Detail': ['parent_bom'], - 'Question': [], - 'Stock Ledger Entry': ['item_code', 'warehouse', 'posting_date', 'posting_time'], - 'Employee Education': [], - 'BOM Operation': [], - 'Item Group': ['lft', 'rgt', 'parent_item_group'], - 'Workflow Action Detail': [], - 'User Setting-Profile': [], - 'Customer Issue': ['item_code', 'customer', 'complaint_date'], - 'Feed': [], - 'Purchase Taxes and Charges': ['account_head'], - 'GL Mapper Detail': [], - 'TDS Detail': [], - 'PRO Detail': ['item_code', 'source_warehouse'], - 'DocType Label': [], - 'Sales Invoice': ['posting_date', 'debit_to', 'project_name'], - 'GL Entry': ['posting_date', 'account', 'voucher_no'], - 'Serial No': ['status', 'warehouse'], - 'Delivery Note': ['posting_date', 'project_name', 'customer'], - 'UOM Conversion Detail': ['uom'], - 'Search Criteria': ['criteria_name'], - 'Salary Structure': [], - 'Educational Qualifications': ['qualification'], - 'TDS Rate Chart': ['applicable_from', 'applicable_to'], - 'GL Mapper': [], - 'Announcement': [], - 'Call Log Details': [], - 'Opportunity': ['lead', 'customer', 'transaction_date'], - 'BOM Explosion Item': ['item_code'], - 'Landed Cost Item': ['account_head'], - 'Field Mapper Detail': ['from_field', 'to_field'], - 'File Data': [], - 'Question Tag': [], - 'Quality Inspection': ['item_code', 'purchase_receipt_no', 'report_date'], - 'Appraisal Goal': [], - 'POS Settings': ['territory'], - 'Delivery Note Item': ['item_code', 'prevdoc_docname', 'warehouse', 'prevdoc_detail_docname'], - 'Profile': [], - 'Other Income Detail': [], - 'Product': ['item_code', 'stock_warehouse'], - 'Purchase Order Item': ['prevdoc_docname', 'item_code', 'prevdoc_detail_docname', 'warehouse'], - 'Module Def Role': ['role'], - 'Sales Team': ['sales_person'], - 'Opportunity Item': ['item_code'], - 'DocType': [], - 'Compaint Note': ['nature_of_complaint', 'compliance_date'], - 'Maintenance Schedule': ['customer', 'sales_order_no'], - 'Event User': ['person'], - 'Stock Reconciliation': ['reconciliation_date'], - 'Purchase Receipt': ['posting_date', 'supplier', 'project_name'], - 'Complaint Detail': ['item_name'], - 'Address': ['customer', 'supplier'], - 'Task': ['request_date', 'allocated_to', 'category', 'customer', 'project'], - 'Territory Target Detail': ['month', 'fiscal_year'], - 'Landed Cost Purchase Receipt': ['purchase_receipt_no'], - 'Customer': ['customer_name', 'customer_group'], - 'Production Plan Sales Order': [], - 'Production Plan Item': ['document_date', 'item_code', 'parent_item'], - 'User Setting-Role Permission': [], - 'Custom Script': ['dt'], - 'Country': [], - 'DefaultValue': [], - 'Multi Ledger Report Detail': [], - 'Salary Slip Earning': ['e_type'], - 'SMS Log': [], - 'Expense Claim Type': [], - 'Item': ['item_group'], - 'Fiscal Year': [], - 'ToDo': ['role'], - 'Purchase Invoice': ['posting_date', 'credit_to', 'project_name', 'supplier'], - 'Journal Voucher Detail': ['account', 'against_voucher', 'against_invoice', 'against_jv'], - 'Online Contact': [], - 'Page': ['module'], - 'Leave Application': ['employee', 'leave_type', 'from_date', 'to_date'], - 'Expense Claim Detail': ['expense_type'], - 'Maintenance Visit': ['customer', 'sales_order_no', 'customer_issue_no'], - 'Item Price': ['price_list_name', 'ref_currency'], - 'SMS Receiver': [], - 'Naming Series Options': ['doc_type'], - 'Activity Type': [], - 'Delivery Note Packing Item': ['item_code', 'parent_item', 'warehouse'], - 'Workflow Rule': ['select_form'], - 'File': ['file_group'], - 'Maintenance Schedule Item': ['item_code', 'start_date', 'end_date', 'prevdoc_docname'], - 'Purchase Order': ['supplier', 'project_name', 'posting_date'], - 'Print Heading': [], - 'TDS Rate Detail': ['category'] - } - #sql("commit") # only required if run from login - exist_dt = [cstr(d[0]) for d in sql("select name from `tabDocType`")] - - for dt in [d for d in dt_index_fields.keys() if d in exist_dt]: - try: - current_index = sql("show indexes from `tab%s`" % dt) - - proper_index = dt_index_fields[dt] - - for d in current_index: - if d[4] not in ['name', 'parent', 'parenttype']: - if d[4] not in proper_index: - sql("ALTER TABLE `tab%s` DROP INDEX %s" % (dt, d[4])) - sql("start transaction") - sql("UPDATE `tabDocField` SET search_index = 0 WHERE fieldname = '%s' AND parent = '%s'" % (d[4], dt)) - sql("commit") - else: - proper_index.remove(d[4]) - - for d in proper_index: - sql("ALTER TABLE `tab%s` ADD INDEX ( `%s` ) " % (dt, d)) - sql("start transaction") - sql("UPDATE `tabDocField` SET search_index = 1 WHERE fieldname = '%s' AND parent = '%s'" % (d, dt)) - sql("commit") - except: - continue - -def execute(): - create_proper_index() diff --git a/patches/before_jan_2012/install_print_formats.py b/patches/before_jan_2012/install_print_formats.py deleted file mode 100644 index d3d8789c88..0000000000 --- a/patches/before_jan_2012/install_print_formats.py +++ /dev/null @@ -1,125 +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 -import os, sys -import webnotes - -path_to_file = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ['print_formats']) - -def prepare_pf_dict(args_list): - """ - - """ - pf_list = [] - for a in args_list: - for pf_type in ['Classic', 'Modern', 'Spartan']: - pf = {} - pf['name'] = " ".join([a['name'], pf_type]) - pf['file'] = os.sep.join([path_to_file, "".join(pf['name'].split(" ")) + ".html"]) - pf['module'] = a['module'] - pf['doc_type'] = a['doc_type'] - pf['standard'] = 'Yes' - pf_list += [pf] - return pf_list - - -pf_to_install = prepare_pf_dict([ - { - 'name' : 'Sales Invoice', - 'doc_type' : 'Sales Invoice', - 'module' : 'Accounts' - }, - { - 'name' : 'Sales Order', - 'doc_type' : 'Sales Order', - 'module' : 'Selling' - }, - { - 'name' : 'Quotation', - 'doc_type' : 'Quotation', - 'module' : 'Selling' - }, - { - 'name' : 'Delivery Note', - 'doc_type' : 'Delivery Note', - 'module' : 'Stock' - }, - { - 'name' : 'Purchase Order', - 'doc_type' : 'Purchase Order', - 'module' : 'Buying' - } -]) - -def execute(): - """ - Install print formats - """ - from webnotes.modules import reload_doc - reload_doc('core', 'doctype', 'print_format') - - #copy_doctype_to_pfs() - global pf_to_install - for pf in pf_to_install: - # install_print_format(pf) - # print "Installed PF: " + pf['name'] - reload_doc(pf['module'], 'Print Format', pf['name']) - - -def copy_doctype_to_pfs(): - """ - Copy doctype to existing print formats - """ - pf_dt_list = webnotes.conn.sql(""" - SELECT format, parent - FROM `tabDocFormat`""", as_list=1) - - from webnotes.model.doc import Document - - for pf, dt in pf_dt_list: - try: - d = Document('Print Format', pf) - d.doc_type = dt - d.save() - except Exception, e: - print e.args - pass - - -def install_print_format(args): - """ - Installs print format - args is a dict consisting of following keys: - * name - * module - * doctype - * standard = "Yes"/"No" - * file - """ - from webnotes.model.doc import Document - d = Document('Print Format') - d.name = args['name'] - f = open(args['file']) - d.html = f.read() - f.close() - d.module = args['module'] - d.doc_type = args['doc_type'] - d.standard = args['standard'] - d.save(1) - from webnotes.model.code import get_obj - obj = get_obj('Print Format', args['name']) - obj.on_update() diff --git a/patches/before_jan_2012/lcw_patch.py b/patches/before_jan_2012/lcw_patch.py deleted file mode 100644 index f5ed4c7d70..0000000000 --- a/patches/before_jan_2012/lcw_patch.py +++ /dev/null @@ -1,26 +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(): - import webnotes - from webnotes.modules import reload_doc - - - reload_doc('stock', 'doctype', 'landed_cost_wizard') - reload_doc('stock', 'doctype', 'lc_pr_detail') - - webnotes.conn.sql("delete from `tabDocField` where parent ='Landed Cost Purchase Receipt' and fieldname in ('purchase_receipt_no', 'include_in_landed_cost')") diff --git a/patches/before_jan_2012/p1.py b/patches/before_jan_2012/p1.py deleted file mode 100644 index 10df020290..0000000000 --- a/patches/before_jan_2012/p1.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(): - import webnotes - if not webnotes.conn.sql("select name from tabDocFormat where parent = 'Sales Invoice' and format != 'POS Invoice'"): - webnotes.conn.sql("update tabDocType set default_print_format = 'Standard' where name = 'Sales Invoice'") diff --git a/patches/before_jan_2012/packing_slip.py b/patches/before_jan_2012/packing_slip.py deleted file mode 100644 index 10ffa86014..0000000000 --- a/patches/before_jan_2012/packing_slip.py +++ /dev/null @@ -1,25 +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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('stock', 'doctype', 'delivery_note_detail') - reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise') - - webnotes.conn.sql("delete from `tabDocField` where fieldname in ('packed_by', 'packing_checked_by', 'pack_size') and parent = 'Delivery Note'") - diff --git a/patches/before_jan_2012/price_list_patch.py b/patches/before_jan_2012/price_list_patch.py deleted file mode 100644 index 41fbd5e751..0000000000 --- a/patches/before_jan_2012/price_list_patch.py +++ /dev/null @@ -1,30 +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(): - import webnotes - from webnotes.modules import reload_doc - - reload_doc('accounts', 'doctype', 'receivable_voucher') - reload_doc('stock', 'doctype', 'delivery_note') - reload_doc('selling', 'doctype', 'sales_order') - reload_doc('selling', 'doctype', 'quotation') - reload_doc('setup', 'doctype', 'manage_account') - - - for d in ['Sales Invoice', 'Delivery Note', 'Sales Order', 'Quotation']: - webnotes.conn.sql("update `tab%s` set price_list_currency = currency, plc_conversion_rate = conversion_rate" % d) diff --git a/patches/before_jan_2012/print_hide_price_list.py b/patches/before_jan_2012/print_hide_price_list.py deleted file mode 100644 index 4295ab48da..0000000000 --- a/patches/before_jan_2012/print_hide_price_list.py +++ /dev/null @@ -1,20 +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(): - import webnotes - webnotes.conn.sql("update `tabDocField` set print_hide = 1 where fieldname in ('price_list_currency', 'plc_conversion_rate')") diff --git a/patches/before_jan_2012/profile_mark_not_in_create.py b/patches/before_jan_2012/profile_mark_not_in_create.py deleted file mode 100644 index aae069476f..0000000000 --- a/patches/before_jan_2012/profile_mark_not_in_create.py +++ /dev/null @@ -1,27 +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 -import webnotes -def execute(): - """ - Mark DocType Profile as 'not_in_create' - """ - webnotes.conn.sql(""" - UPDATE `tabDocType` - SET in_create=1 - WHERE name='Profile' - """) diff --git a/patches/before_jan_2012/project_patch.py b/patches/before_jan_2012/project_patch.py deleted file mode 100644 index 735714d74c..0000000000 --- a/patches/before_jan_2012/project_patch.py +++ /dev/null @@ -1,35 +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(): - import webnotes - from webnotes.modules import reload_doc - sql = webnotes.conn.sql - - # Reload item table - reload_doc('accounts', 'doctype', 'pv_detail') - reload_doc('buying', 'doctype', 'po_detail') - reload_doc('stock', 'doctype', 'purchase_receipt_detail') - - # copy project value from parent to child - sql("update `tabPurchase Order Item` t1, `tabPurchase Order` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''") - sql("update `tabPurchase Invoice Item` t1, `tabPurchase Invoice` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''") - sql("update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''") - - # delete project from parent - sql("delete from `tabDocField` where fieldname = 'project_name' and parent in ('Purchase Order', 'Purchase Receipt', 'Purchase Invoice')") - diff --git a/patches/before_jan_2012/reload_address.py b/patches/before_jan_2012/reload_address.py deleted file mode 100644 index 781a00b1e0..0000000000 --- a/patches/before_jan_2012/reload_address.py +++ /dev/null @@ -1,22 +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(): - import webnotes - from webnotes.modules import reload_doc - - reload_doc('utilities', 'doctype', 'address') diff --git a/patches/before_jan_2012/reload_bom.py b/patches/before_jan_2012/reload_bom.py deleted file mode 100644 index 0492d72f50..0000000000 --- a/patches/before_jan_2012/reload_bom.py +++ /dev/null @@ -1,22 +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(): - import webnotes - from webnotes.modules import reload_doc - - reload_doc('production', 'doctype', 'bill_of_materials') diff --git a/patches/before_jan_2012/reload_doclayer.py b/patches/before_jan_2012/reload_doclayer.py deleted file mode 100644 index 2da9187884..0000000000 --- a/patches/before_jan_2012/reload_doclayer.py +++ /dev/null @@ -1,33 +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 -""" - Reload Customize Form, Customize Form Field and Print Format doctypes -""" -def execute(): - from webnotes.modules import reload_doc - reload_doc('core', 'doctype', 'print_format') - reload_doc('core', 'doctype', 'doclayer') - reload_doc('core', 'doctype', 'doclayerfield') - reload_doc('accounts', 'doctype', 'gl_entry') - from webnotes.model.doc import Document - d = Document('DocType Label') - d.dt = "Customize Form" - d.dt_label = "Customize Form View" - d.save(1) - from webnotes.sessions import clear - clear() diff --git a/patches/before_jan_2012/reload_email_digest.py b/patches/before_jan_2012/reload_email_digest.py deleted file mode 100644 index 8e0852cfbf..0000000000 --- a/patches/before_jan_2012/reload_email_digest.py +++ /dev/null @@ -1,20 +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(): - from webnotes.modules import reload_doc - reload_doc('Setup', 'DocType', 'Email Digest') diff --git a/patches/before_jan_2012/reload_employeewise_balance_leave_report.py b/patches/before_jan_2012/reload_employeewise_balance_leave_report.py deleted file mode 100644 index 1e8ce40b9d..0000000000 --- a/patches/before_jan_2012/reload_employeewise_balance_leave_report.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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('hr', 'search_criteria', 'employeewise_balance_leave_report') diff --git a/patches/before_jan_2012/reload_flat_bom.py b/patches/before_jan_2012/reload_flat_bom.py deleted file mode 100644 index 7c648ff3c5..0000000000 --- a/patches/before_jan_2012/reload_flat_bom.py +++ /dev/null @@ -1,23 +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(): - from webnotes.modules import webnotes - from webnotes.modules import reload_doc - - reload_doc('production', 'doctype', 'flat_bom_detail') - reload_doc('production', 'doctype', 'bom_material') diff --git a/patches/before_jan_2012/reload_gl_mapper.py b/patches/before_jan_2012/reload_gl_mapper.py deleted file mode 100644 index cf67c5c7f8..0000000000 --- a/patches/before_jan_2012/reload_gl_mapper.py +++ /dev/null @@ -1,23 +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(): - import webnotes - from webnotes.modules import reload_doc - - # reload jv gl mapper - reload_doc('accounts', 'GL Mapper', 'Journal Voucher') diff --git a/patches/before_jan_2012/reload_lc_wizard.py b/patches/before_jan_2012/reload_lc_wizard.py deleted file mode 100644 index 3de71da0a0..0000000000 --- a/patches/before_jan_2012/reload_lc_wizard.py +++ /dev/null @@ -1,26 +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(): - import webnotes - from webnotes.modules import reload_doc - from webnotes.model import delete_doc - - delete_doc('DocType', 'Landed Cost Wizard') - delete_doc('DocType', 'Landed Cost Purchase Receipt') - reload_doc('stock', 'doctype', 'landed_cost_wizard') - reload_doc('stock', 'doctype', 'lc_pr_detail') diff --git a/patches/before_jan_2012/reload_print_format.py b/patches/before_jan_2012/reload_print_format.py deleted file mode 100644 index d775c0c9cc..0000000000 --- a/patches/before_jan_2012/reload_print_format.py +++ /dev/null @@ -1,34 +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(): - import webnotes - from webnotes.modules import reload_doc - from webnotes.model.doc import addchild - from webnotes.model.code import get_obj - reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise') - reload_doc('stock', 'Print Format', 'Purchase Receipt Format') - reload_doc('accounts', 'Print Format', 'Payment Receipt Voucher') - reload_doc('accounts', 'Print Format', 'POS Invoice') - reload_doc('accounts', 'Print Format', 'Form 16A Print Format') - reload_doc('accounts', 'Print Format', 'Cheque Printing Format') - - if not webnotes.conn.sql("select format from `tabDocFormat` where name = 'POS Invoice' and parent = 'Sales Invoice'"): - dt_obj = get_obj('DocType', 'Sales Invoice', with_children = 1) - ch = addchild(dt_obj.doc, 'formats', 'DocFormat', 1) - ch.format = 'POS Invoice' - ch.save(1) diff --git a/patches/before_jan_2012/reload_project_task.py b/patches/before_jan_2012/reload_project_task.py deleted file mode 100644 index c6b38d55dd..0000000000 --- a/patches/before_jan_2012/reload_project_task.py +++ /dev/null @@ -1,24 +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 -""" - Reload Task Doctype of Project Module -""" -def execute(): - from webnotes.modules import reload_doc - reload_doc('Projects', 'DocType', 'Task') - diff --git a/patches/before_jan_2012/reload_reco.py b/patches/before_jan_2012/reload_reco.py deleted file mode 100644 index 2c303c5ff4..0000000000 --- a/patches/before_jan_2012/reload_reco.py +++ /dev/null @@ -1,23 +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(): - import webnotes - from webnotes.modules import reload_doc - - reload_doc('stock', 'doctype', 'stock_reconciliation') - webnotes.conn.sql("delete from `tabDocField` where (label in ('Validate Data', 'Attachment HTML', 'Attachment') or fieldname in ('next_step', 'company', 'fiscal_year', 'amendment_date')) and parent = 'Stock Reconciliation'") diff --git a/patches/before_jan_2012/reload_rv.py b/patches/before_jan_2012/reload_rv.py deleted file mode 100644 index 3c7b5be4c5..0000000000 --- a/patches/before_jan_2012/reload_rv.py +++ /dev/null @@ -1,26 +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(): - import webnotes - from webnotes.modules import reload_doc - from webnotes.model.code import get_obj - - reload_doc('accounts', 'doctype', 'receivable_voucher') - - reload_doc('setup', 'doctype', 'features_setup') - get_obj('Features setup').validate() diff --git a/patches/before_jan_2012/reload_support_ticket.py b/patches/before_jan_2012/reload_support_ticket.py deleted file mode 100644 index 0fe611b878..0000000000 --- a/patches/before_jan_2012/reload_support_ticket.py +++ /dev/null @@ -1,23 +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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('Support', 'DocType', 'Support Ticket') - from webnotes.model.code import get_obj - get_obj('DocType', 'Support Ticket').validate() diff --git a/patches/before_jan_2012/remove_duplicate_table_mapper_detail.py b/patches/before_jan_2012/remove_duplicate_table_mapper_detail.py deleted file mode 100644 index 3594a70724..0000000000 --- a/patches/before_jan_2012/remove_duplicate_table_mapper_detail.py +++ /dev/null @@ -1,39 +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 -""" - Removes duplicate entries created in -""" -import webnotes -def execute(): - res = webnotes.conn.sql("""\ - SELECT a.name - FROM - `tabTable Mapper Detail` a, - `tabTable Mapper Detail` b - WHERE - a.parent = b.parent AND - a.from_table = b.from_table AND - a.to_table = b.to_table AND - a.from_field = b.from_field AND - a.to_field = b.to_field AND - a.name < b.name""") - if res and len(res)>0: - name_string = ", ".join(["'" + str(r[0]) + "'" for r in res]) - res = webnotes.conn.sql("""\ - DELETE FROM `tabTable Mapper Detail` - WHERE name IN (%s)""" % name_string) diff --git a/patches/before_jan_2012/remove_extra_button_from_email_digest.py b/patches/before_jan_2012/remove_extra_button_from_email_digest.py deleted file mode 100644 index fa2481d9d5..0000000000 --- a/patches/before_jan_2012/remove_extra_button_from_email_digest.py +++ /dev/null @@ -1,25 +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(): - import webnotes - webnotes.conn.sql(""" - DELETE FROM tabDocField - WHERE parent = 'Email Digest' - AND label = 'Add Recipients' - AND fieldtype = 'Button'""") - diff --git a/patches/before_jan_2012/remove_old_cp_email_settings.py b/patches/before_jan_2012/remove_old_cp_email_settings.py deleted file mode 100644 index 64174411d9..0000000000 --- a/patches/before_jan_2012/remove_old_cp_email_settings.py +++ /dev/null @@ -1,32 +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(): - """ - remove control panel email settings if automail.webnotestech.com - """ - from webnotes.model.doc import Document - cp = Document('Control Panel', 'Control Panel') - if cp: - if cp.outgoing_mail_server == 'mail.webnotestech.com': - cp.outgoing_mail_server = None; - cp.mail_login = None; - cp.mail_password = None; - cp.mail_port = None; - cp.auto_email_id = 'automail@erpnext.com' - cp.save() - diff --git a/patches/before_jan_2012/remove_page_break_from_defaults.py b/patches/before_jan_2012/remove_page_break_from_defaults.py deleted file mode 100644 index 8ee441a28a..0000000000 --- a/patches/before_jan_2012/remove_page_break_from_defaults.py +++ /dev/null @@ -1,20 +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(): - import webnotes - webnotes.conn.sql("""delete from `tabDefaultValue` where defkey in ('page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos', 'purchase_discounts', 'recurring_invoice') and parent = 'Control Panel'""") diff --git a/patches/before_jan_2012/remove_previous_field_property_setter.py b/patches/before_jan_2012/remove_previous_field_property_setter.py deleted file mode 100644 index a993a2528f..0000000000 --- a/patches/before_jan_2012/remove_previous_field_property_setter.py +++ /dev/null @@ -1,23 +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 -import webnotes -def execute(): - webnotes.conn.sql("""\ - DELETE FROM `tabProperty Setter` - WHERE property='previous_field' - """) diff --git a/patches/before_jan_2012/repost_account_bal.py b/patches/before_jan_2012/repost_account_bal.py deleted file mode 100644 index b1d68c7d0f..0000000000 --- a/patches/before_jan_2012/repost_account_bal.py +++ /dev/null @@ -1,36 +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(): - import webnotes - sql = webnotes.conn.sql - from webnotes.model.code import get_obj - - # repost - comp = sql("select name from tabCompany where docstatus!=2") - fy = sql("select name from `tabFiscal Year` order by year_start_date asc") - for c in comp: - prev_fy = '' - for f in fy: - fy_obj = get_obj('Fiscal Year', f[0]) - fy_obj.doc.past_year = prev_fy - fy_obj.doc.company = c[0] - fy_obj.repost() - prev_fy = f[0] - webnotes.conn.commit() - webnotes.conn.begin() \ No newline at end of file diff --git a/patches/before_jan_2012/repost_stock.py b/patches/before_jan_2012/repost_stock.py deleted file mode 100644 index 3976ebaa44..0000000000 --- a/patches/before_jan_2012/repost_stock.py +++ /dev/null @@ -1,40 +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(): - import webnotes - sql = webnotes.conn.sql - from webnotes.model.code import get_obj - from webnotes.utils import flt - - # update incoming rate in serial nos - sr = sql("""select name, item_code, purchase_document_no from `tabSerial No` - where docstatus = 1 and purchase_document_type = 'Purchase Receipt'""") - for d in sr: - val_rate = sql("""select valuation_rate from `tabPurchase Receipt Item` - where item_code = %s and parent = %s""", (d[1], d[2])) - sql("""update `tabSerial No` set purchase_rate = %s where name = %s""", - (val_rate and flt(val_rate[0][0]) or 0, d[0])) - - - # repost for all serialized item - bin = sql("""select t1.name from `tabBin` t1, tabItem t2 where t1.item_code = t2.name and ifnull(has_serial_no, 'No') = 'Yes'""") - for d in bin: - get_obj('Bin', d[0]).update_entries_after(posting_date = '2000-01-01', posting_time = '12:00') - sql("commit") - sql("start transaction") - diff --git a/patches/before_jan_2012/sal_man_patch.py b/patches/before_jan_2012/sal_man_patch.py deleted file mode 100644 index b6dd6f0408..0000000000 --- a/patches/before_jan_2012/sal_man_patch.py +++ /dev/null @@ -1,25 +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(): - import webnotes - from webnotes.modules import reload_doc - sql = webnotes.conn.sql - - reload_doc('hr', 'doctype', 'salary_manager') - sql("delete from `tabDocField` where parent = 'Salary Manager' and fieldname = 'employment_type'") diff --git a/patches/before_jan_2012/task_email_notification.py b/patches/before_jan_2012/task_email_notification.py deleted file mode 100644 index 5e8b3945c9..0000000000 --- a/patches/before_jan_2012/task_email_notification.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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('projects', 'doctype', 'ticket') diff --git a/patches/before_jan_2012/update_0_idx.py b/patches/before_jan_2012/update_0_idx.py deleted file mode 100644 index 9a192e5cb8..0000000000 --- a/patches/before_jan_2012/update_0_idx.py +++ /dev/null @@ -1,26 +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 -import webnotes -def execute(): - doc_type_list = webnotes.conn.sql("""SELECT DISTINCT parent FROM `tabDocField` where idx=0""") - for doc_type in doc_type_list: - if doc_type and doc_type[0]: - webnotes.conn.sql("""\ - UPDATE `tabDocField` SET idx=idx+1 - WHERE parent=%s - """, doc_type[0]) diff --git a/patches/before_jan_2012/update_gle_against_voucher_for_jv.py b/patches/before_jan_2012/update_gle_against_voucher_for_jv.py deleted file mode 100644 index b262778ee9..0000000000 --- a/patches/before_jan_2012/update_gle_against_voucher_for_jv.py +++ /dev/null @@ -1,32 +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(): - import webnotes - from webnotes.model.code import get_obj - - # select jv where against_jv exists - jv = webnotes.conn.sql("select distinct parent from `tabJournal Voucher Detail` where docstatus = 1 and ifnull(against_jv, '') != ''") - - for d in jv: - jv_obj = get_obj('Journal Voucher', d[0], with_children=1) - - # cancel - get_obj(dt='GL Control').make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel =1, adv_adj = 1) - - #re-submit - get_obj(dt='GL Control').make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel =0, adv_adj = 1) diff --git a/patches/jan_mar_2012/__init__.py b/patches/jan_mar_2012/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/patches/jan_mar_2012/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/patches/jan_mar_2012/account_type_patch.py b/patches/jan_mar_2012/account_type_patch.py deleted file mode 100644 index c6ac05c9ba..0000000000 --- a/patches/jan_mar_2012/account_type_patch.py +++ /dev/null @@ -1,26 +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(): - import webnotes - webnotes.conn.sql("""update `tabAccount` - set account_type = 'Chargeable' - where account_name in ('CENVAT Capital Goods', 'CENVAT Service Tax', 'CENVAT Service Tax Cess 1', 'CENVAT Service Tax Cess 2', - 'P L A', 'P L A - Cess Portion', 'VAT', 'TDS (Advertisement)', 'TDS (Commission)', 'TDS (Contractor)', 'TDS (Interest)', - 'TDS (Rent)', 'TDS (Salary)') - """) - diff --git a/patches/jan_mar_2012/add_roles_to_admin.py b/patches/jan_mar_2012/add_roles_to_admin.py deleted file mode 100644 index f2e91e968c..0000000000 --- a/patches/jan_mar_2012/add_roles_to_admin.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import unicode_literals -def execute(): - """ - Adds various roles to Administrator. This patch is for making master db - ready for on premise installation - """ - import webnotes - from webnotes.model.code import get_obj - from webnotes.model.doc import Document - sc = get_obj('Setup Control', 'Setup Control') - sc.add_roles(Document('Profile', 'Administrator')) diff --git a/patches/jan_mar_2012/allocated_to_profile.py b/patches/jan_mar_2012/allocated_to_profile.py deleted file mode 100644 index b38f97b7fc..0000000000 --- a/patches/jan_mar_2012/allocated_to_profile.py +++ /dev/null @@ -1,37 +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(): - """ - Changes allocated_to option to Profile in - DocType Customer Issue - """ - import webnotes - webnotes.conn.sql(""" - UPDATE `tabDocField` - SET options='Profile' - WHERE fieldname='allocated_to' - """) - - webnotes.conn.sql(""" - DELETE from `tabDocField` - WHERE parent='Customer Issue' - AND label='Make Maintenance Visit' - """) - - from webnotes.modules import reload_doc - reload_doc('support', 'doctype', 'customer_issue') diff --git a/patches/jan_mar_2012/apps/__init__.py b/patches/jan_mar_2012/apps/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/patches/jan_mar_2012/apps/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/patches/jan_mar_2012/apps/todo_item.py b/patches/jan_mar_2012/apps/todo_item.py deleted file mode 100644 index ed0acc4b0b..0000000000 --- a/patches/jan_mar_2012/apps/todo_item.py +++ /dev/null @@ -1,23 +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 ToDo - """ - from webnotes.modules import reload_doc - reload_doc('utilities', 'doctype', 'todo_item') diff --git a/patches/jan_mar_2012/cancel_purchase_returned.py b/patches/jan_mar_2012/cancel_purchase_returned.py deleted file mode 100644 index ff287c56c4..0000000000 --- a/patches/jan_mar_2012/cancel_purchase_returned.py +++ /dev/null @@ -1,25 +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(): - """ - Set docstatus = 2 where status = 'Purchase Returned' for serial no - """ - import webnotes - webnotes.conn.sql("""\ - UPDATE `tabSerial No` SET docstatus=2 - WHERE status='Purchase Returned'""") diff --git a/patches/jan_mar_2012/clear_session_cache.py b/patches/jan_mar_2012/clear_session_cache.py deleted file mode 100644 index 0490f50111..0000000000 --- a/patches/jan_mar_2012/clear_session_cache.py +++ /dev/null @@ -1,20 +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(): - import webnotes - webnotes.clear_cache() diff --git a/patches/jan_mar_2012/convert_tables_to_utf8.py b/patches/jan_mar_2012/convert_tables_to_utf8.py deleted file mode 100644 index 9378aba7f3..0000000000 --- a/patches/jan_mar_2012/convert_tables_to_utf8.py +++ /dev/null @@ -1,28 +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 -import webnotes - -def execute(): - sql = webnotes.conn.sql - - sql("commit") - sql("set foreign_key_checks=0") - for tab in sql("show tables"): - sql("ALTER TABLE `%s` CONVERT TO CHARACTER SET utf8" % tab[0]) - - sql("set foreign_key_checks=1") diff --git a/patches/jan_mar_2012/customer_address_contact_patch.py b/patches/jan_mar_2012/customer_address_contact_patch.py deleted file mode 100644 index 8a3e67a53d..0000000000 --- a/patches/jan_mar_2012/customer_address_contact_patch.py +++ /dev/null @@ -1,75 +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 -import webnotes - -def execute(): - """ - * Reload Search Criteria "Customer Address Contact" - * SET is_primary_contact=1, is_primary_address=1 WHERE not specified - """ - reload_sc() - patch_primary_contact() - patch_primary_address() - -def reload_sc(): - from webnotes.modules import reload_doc - reload_doc('selling', 'search_criteria', 'customer_address_contact') - reload_doc('selling', 'Module Def', 'Selling') - -def patch_primary_contact(): - res = webnotes.conn.sql(""" - SELECT name FROM `tabContact` - WHERE customer IN ( - SELECT customer FROM `tabContact` - WHERE IFNULL(customer, '')!='' - GROUP BY customer HAVING SUM(IFNULL(is_primary_contact, 0))=0 - ) OR supplier IN ( - SELECT supplier FROM `tabContact` - WHERE IFNULL(supplier, '')!='' - GROUP BY supplier HAVING SUM(IFNULL(is_primary_contact, 0))=0 - ) OR sales_partner IN ( - SELECT sales_partner FROM `tabContact` - WHERE IFNULL(sales_partner, '')!='' - GROUP BY sales_partner HAVING SUM(IFNULL(is_primary_contact, 0))=0 - ) - """, as_list=1) - names = ", ".join(['"' + unicode(r[0]) + '"' for r in res if r]) - if names: webnotes.conn.sql("UPDATE `tabContact` SET is_primary_contact=1 WHERE name IN (%s)" % names) - -def patch_primary_address(): - res = webnotes.conn.sql(""" - SELECT name FROM `tabAddress` - WHERE customer IN ( - SELECT customer FROM `tabAddress` - WHERE IFNULL(customer, '')!='' - GROUP BY customer HAVING SUM(IFNULL(is_primary_address, 0))=0 - AND SUM(IFNULL(is_shipping_address, 0))=0 - ) OR supplier IN ( - SELECT supplier FROM `tabAddress` - WHERE IFNULL(supplier, '')!='' - GROUP BY supplier HAVING SUM(IFNULL(is_primary_address, 0))=0 - AND SUM(IFNULL(is_shipping_address, 0))=0 - ) OR sales_partner IN ( - SELECT sales_partner FROM `tabAddress` - WHERE IFNULL(sales_partner, '')!='' - GROUP BY sales_partner HAVING SUM(IFNULL(is_primary_address, 0))=0 - AND SUM(IFNULL(is_shipping_address, 0))=0 - ) - """, as_list=1) - names = ", ".join(['"' + unicode(r[0]) + '"' for r in res if r]) - if names: webnotes.conn.sql("UPDATE `tabAddress` SET is_primary_address=1 WHERE name IN (%s)" % names) diff --git a/patches/jan_mar_2012/delete_pur_of_service.py b/patches/jan_mar_2012/delete_pur_of_service.py deleted file mode 100644 index 18ded0d199..0000000000 --- a/patches/jan_mar_2012/delete_pur_of_service.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(): - import webnotes - from webnotes.model import delete_doc - delete_doc('DocType', 'Purpose of Service') diff --git a/patches/jan_mar_2012/deploy_packing_slip.py b/patches/jan_mar_2012/deploy_packing_slip.py deleted file mode 100644 index a6ec881e73..0000000000 --- a/patches/jan_mar_2012/deploy_packing_slip.py +++ /dev/null @@ -1,65 +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 -import webnotes -from webnotes.modules import reload_doc - -def execute(): - delete_fields_dn_detail() - deploy_packing_slip() - del_packing_slip_pf() - - -def delete_fields_dn_detail(): - """ - Delete old fields related to packing slip - """ - from webnotes.model import delete_fields - delete_fields({ - 'Delivery Note': [ - 'print_packing_slip', 'shipping_mark', 'packed_by', - 'packing_checked_by', 'Text', 'pack_size' - ], - 'Delivery Note Item': [ - 'pack_no', 'pack_gross_wt', 'weight_uom', - 'pack_nett_wt', 'no_of_packs', 'pack_unit', 'pack_size', - 'packed_by', 'packing_checked_by' - ] - }, delete=1) - delete_fields({'Item': ['nett_weight', 'gross_weight']}, delete=1) - reload_doc('stock', 'doctype', 'delivery_note') - reload_doc('stock', 'doctype', 'delivery_note_detail') - reload_doc('stock', 'doctype', 'item') - - -def deploy_packing_slip(): - reload_doc('stock', 'doctype', 'packing_slip') - reload_doc('stock', 'doctype', 'packing_slip_detail') - reload_doc('stock', 'Module Def', 'Stock') - reload_doc('stock', 'DocType Mapper', 'Delivery Note-Packing Slip') - - -def del_packing_slip_pf(): - """ - Delete Print Format: 'Delivery Note Packing List Wise' - """ - webnotes.conn.sql("""\ - DELETE FROM `tabDocFormat` - WHERE parent='Delivery Note' - AND format='Delivery Note Packing List Wise'""") - from webnotes.model import delete_doc - delete_doc('Print Format', 'Delivery Note Packing List Wise') diff --git a/patches/jan_mar_2012/doclabel_in_doclayer.py b/patches/jan_mar_2012/doclabel_in_doclayer.py deleted file mode 100644 index 4e6260e899..0000000000 --- a/patches/jan_mar_2012/doclabel_in_doclayer.py +++ /dev/null @@ -1,29 +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 -import webnotes -def execute(): - """ - * Change option of doclayer's doc_type field - * Reload doclayer - """ - webnotes.conn.sql(""" - UPDATE `tabDocField` SET options=NULL - WHERE parent='Customize Form' AND fieldname='doc_type' - """) - from webnotes.modules import reload_doc - reload_doc('core', 'doctype', 'doclayer') diff --git a/patches/jan_mar_2012/dt_map_fix.py b/patches/jan_mar_2012/dt_map_fix.py deleted file mode 100644 index d682102a8d..0000000000 --- a/patches/jan_mar_2012/dt_map_fix.py +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.modules import reload_doc - webnotes.conn.sql("delete from `tabField Mapper Detail` where from_field = 'transaction_date' and parent in ('Sales Order-Delivery Note', 'Purchase Order-Purchase Receipt')") - - reload_doc('stock', 'DocType Mapper', 'Sales Order-Delivery Note') - reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt') diff --git a/patches/jan_mar_2012/email_settings_reload.py b/patches/jan_mar_2012/email_settings_reload.py deleted file mode 100644 index fe6b26025a..0000000000 --- a/patches/jan_mar_2012/email_settings_reload.py +++ /dev/null @@ -1,30 +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(): - """ - * Change type of mail_port field to int - * reload email settings - """ - import webnotes - webnotes.conn.sql(""" - UPDATE `tabDocField` SET fieldtype='Int' - WHERE parent = 'Email Settings' AND fieldname = 'mail_port' - """) - - from webnotes.modules import reload_doc - reload_doc('setup', 'doctype', 'email_settings') diff --git a/patches/jan_mar_2012/fix_packing_slip.py b/patches/jan_mar_2012/fix_packing_slip.py deleted file mode 100644 index 218d89d227..0000000000 --- a/patches/jan_mar_2012/fix_packing_slip.py +++ /dev/null @@ -1,37 +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(): - """ - * Change DN to PS mapper - + Set Ref doc should be submitted to 0 - + Set validation logic of DN PS Table mapper record to docstatus=0 - """ - import webnotes - webnotes.conn.sql("""\ - UPDATE `tabDocType Mapper` - SET ref_doc_submitted=0 - WHERE name='Delivery Note-Packing Slip'""") - - webnotes.conn.sql("""\ - UPDATE `tabTable Mapper Detail` - SET validation_logic='docstatus=0' - WHERE parent='Delivery Note-Packing Slip' - AND docstatus=0 - AND from_table='Delivery Note' - AND to_table='Packing Slip'""") - diff --git a/patches/jan_mar_2012/jan_production_patches.py b/patches/jan_mar_2012/jan_production_patches.py deleted file mode 100644 index 87b92052b0..0000000000 --- a/patches/jan_mar_2012/jan_production_patches.py +++ /dev/null @@ -1,44 +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 -import webnotes -def execute(): - """ - Patch includes: - * Reload of Stock Entry Detail - """ - from webnotes.modules import reload_doc - - reload_doc('stock', 'doctype', 'stock_entry_detail') - reload_doc('stock', 'doctype', 'item_supplier') - reload_doc('stock', 'doctype', 'item') - - webnotes.conn.sql(""" - UPDATE tabDocField SET fieldtype='Float' - WHERE parent='BOM' - AND fieldname IN ('operating_cost', 'raw_material_cost', 'total_cost') - """) - - webnotes.conn.sql(""" - UPDATE tabDocField SET fieldtype='Float' - WHERE parent='BOM Item' - AND fieldname IN ('qty', 'rate', 'amount', 'qty_consumed_per_unit') - """) - - reload_doc('stock', 'doctype', 'stock_entry') - reload_doc('production', 'doctype', 'bill_of_materials') - reload_doc('production', 'doctype', 'bom_material') diff --git a/patches/jan_mar_2012/label_cleanup.py b/patches/jan_mar_2012/label_cleanup.py deleted file mode 100644 index 4f4fc4e883..0000000000 --- a/patches/jan_mar_2012/label_cleanup.py +++ /dev/null @@ -1,38 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.model import delete_doc - from webnotes.modules import reload_doc - - - webnotes.conn.sql("""delete from `tabDocField` - where label in ('Note1', 'OT Notes', 'Note', 'Note HTML', 'Rates HTML') - and parent in ('Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice', 'Purchase Order')""") - - - del_flds = { - 'Sales Order Item': "'delivery_date', 'confirmation_date'", - 'Delivery Note': "'supplier', 'supplier_address', 'purchase_receipt_no', 'purchase_order_no', 'transaction_date'", - 'Sales Invoice': "'voucher_date'", - 'Purchase Invoice': "'voucher_date'", - 'Purchase Receipt': "'transaction_date'" - } - - del_labels = { - 'Delivery Note': "'Supplier Details'", - 'Purchase Receipt': "'Get Currrent Stock'" - } - - for d in del_flds: - webnotes.conn.sql("delete from `tabDocField` where fieldname in (%s) and parent = '%s'"% (del_flds[d], d)) - - for d in del_labels: - webnotes.conn.sql("delete from `tabDocField` where label in (%s) and parent = '%s'"% (del_labels[d], d)) - - delete_doc('DocType', 'Update Delivery Date Detail') - - # Reload print formats - reload_doc('accounts', 'Print Format', 'Sales Invoice Classic') - reload_doc('accounts', 'Print Format', 'Sales Invoice Modern') - reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan') - diff --git a/patches/jan_mar_2012/map_conversion_rate.py b/patches/jan_mar_2012/map_conversion_rate.py deleted file mode 100644 index 7e5e7c574a..0000000000 --- a/patches/jan_mar_2012/map_conversion_rate.py +++ /dev/null @@ -1,68 +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 -import webnotes -from webnotes.model.code import get_obj -from webnotes.model.doc import addchild - -def execute(): - """ - * Maps conversion rate in doctype mapper PO-PR - * Maps conversion rate in doctype mapper PO-PV - """ - args = [ - { - 'parent': 'Purchase Order-Purchase Receipt', - 'map': [{ - 'from_table': 'Purchase Order', - 'to_table': 'Purchase Receipt', - 'fields': [['conversion_rate', 'conversion_rate', 'Yes']] - }] - }, - { - 'parent': 'Purchase Order-Purchase Invoice', - 'map': [{ - 'from_table': 'Purchase Order', - 'to_table': 'Purchase Invoice', - 'fields': [['conversion_rate', 'conversion_rate', 'Yes']] - }] - }, - ] - - for a in args: - for m in a['map']: - match_id = webnotes.conn.sql("""\ - SELECT match_id FROM `tabTable Mapper Detail` - WHERE parent=%s AND from_table=%s AND to_table=%s\ - """, (a['parent'], m['from_table'], m['to_table']))[0][0] - for f in m['fields']: - res = webnotes.conn.sql("""\ - SELECT name FROM `tabField Mapper Detail` - WHERE parent=%s AND from_field=%s AND to_field=%s - AND match_id=%s""", (a['parent'], f[0], f[1], match_id)) - if not res: - max_idx = webnotes.conn.sql("""\ - SELECT IFNULL(MAX(idx), 0) FROM `tabField Mapper Detail` - WHERE parent=%s""", a['parent'])[0][0] - obj = get_obj('DocType Mapper', a['parent']) - c = addchild(obj.doc, 'field_mapper_details', 'Field Mapper Detail', obj.doclist) - c.from_field = f[0] - c.to_field = f[1] - c.fields['map'] = f[2] - c.match_id = match_id - c.idx = max_idx + 1 - c.save() diff --git a/patches/jan_mar_2012/mapper_fix.py b/patches/jan_mar_2012/mapper_fix.py deleted file mode 100644 index e8e68e0a25..0000000000 --- a/patches/jan_mar_2012/mapper_fix.py +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - webnotes.conn.sql("delete from `tabTable Mapper Detail` where to_table = 'Sales Invoice Item' and parent = 'Delivery Note-Sales Invoice' and validation_logic = 'amount > ifnull(billed_amt, 0) and docstatus = 1'") diff --git a/patches/jan_mar_2012/navupdate.py b/patches/jan_mar_2012/navupdate.py deleted file mode 100644 index a99f92416f..0000000000 --- a/patches/jan_mar_2012/navupdate.py +++ /dev/null @@ -1,60 +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 -import webnotes -import _mysql_exceptions - -def execute(): - from webnotes.modules import reload_doc - reload_doc('accounts', 'page', 'accounts_home') - reload_doc('selling', 'page', 'selling_home') - reload_doc('buying', 'page', 'buying_home') - reload_doc('stock', 'page', 'stock_home') - reload_doc('hr', 'page', 'hr_home') - reload_doc('support', 'page', 'support_home') - reload_doc('production', 'page', 'production_home') - reload_doc('projects', 'page', 'projects_home') - reload_doc('website', 'page', 'website_home') - reload_doc('home', 'page', 'desktop') - reload_doc('utilities', 'page', 'todo') - reload_doc('utilities', 'page', 'calendar') - reload_doc('utilities', 'page', 'messages') - reload_doc('setup', 'page', 'modules_setup') - reload_doc('utilities', 'page', 'users') - reload_doc('home', 'page', 'activity') - reload_doc('home', 'page', 'attributions') - reload_doc('core', 'doctype', 'profile') - - # update user_image in profile - for p in webnotes.conn.sql("""select name, file_list from tabProfile - where ifnull(file_list,'')!=''"""): - fid = p[1].split('\n')[0].split(',')[1] - webnotes.conn.set_value('Profile', p[0], 'user_image', fid) - - webnotes.conn.set_value('Control Panel', 'Control Panel', 'home_page', - 'desktop') - - webnotes.conn.commit() - - try: - webnotes.conn.sql("""create table __SchedulerLog ( - `timestamp` timestamp, - method varchar(200), - error text - ) engine=MyISAM""") - except _mysql_exceptions.OperationalError, e: - pass diff --git a/patches/jan_mar_2012/no_copy_patch.py b/patches/jan_mar_2012/no_copy_patch.py deleted file mode 100644 index c7d33cb7fb..0000000000 --- a/patches/jan_mar_2012/no_copy_patch.py +++ /dev/null @@ -1,20 +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(): - import webnotes - webnotes.conn.sql("update `tabDocField` set no_copy = 1 where fieldname = 'insert_after' and parent = 'Custom Field'") diff --git a/patches/jan_mar_2012/pending_patches.py b/patches/jan_mar_2012/pending_patches.py deleted file mode 100644 index f98b13fc28..0000000000 --- a/patches/jan_mar_2012/pending_patches.py +++ /dev/null @@ -1,67 +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(): - import webnotes - from webnotes.model.code import get_obj - from webnotes.modules import reload_doc - sql = webnotes.conn.sql - - reload_doc('hr', 'doctype', 'appraisal') - - sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'") - sql("update tabDocPerm set amend = 0 where parent = 'Salary Structure'") - sql("update tabDocPerm set cancel = 1 where parent = 'Company' and role = 'System Manager'") - - if sql("select count(name) from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1: - sql("delete from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1") - if sql("select count(name) from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1: - sql("delete from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1") - - - if sql("select count(name) from `tabDocField` where label = 'Get Specification Details' and parent = 'Quality Inspection' and fieldtype = 'Button'")[0][0] > 1: - sql("delete from `tabDocField` where label = 'Get Specification Details' and parent = 'Quality Inspection' and fieldtype = 'Button' limit 1") - - reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt') - - reload_doc('accounts', 'doctype', 'cost_center') - sql("update `tabDocType` set subject = 'Item Code: %(item_code)s, Warehouse: %(warehouse)s' where name = 'Serial No'") - - # Patch for adding packing related columns (packed by, checked by, shipping mark etc) - reload_doc('stock','doctype','delivery_note') - sql("update `tabDocField` set allow_on_submit = 1 where fieldname = 'page_break'") - sql("update `tabDocField` set allow_on_submit = 1 where fieldname in ('indent_details', 'po_details', 'purchase_receipt_details', 'entries', 'sales_order_details', 'delivery_note_details', 'quotation_details') and fieldtype = 'Table'") - - from webnotes.sessions import clear_cache - clear_cache(webnotes.session['user']) - - # FEATURES SETUP - #---------------- - reload_doc('setup', 'doctype','features_setup') - flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos'] - st = "'"+"', '".join(flds)+"'" - sql("delete from `tabSingles` where field in (%s) and doctype = 'Features Setup'" % st) - sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st) - sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st) - - if not sql("select * from `tabDefaultValue` where defkey like 'fs_%' and parent = 'Control Panel'"): - rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null") - fs = get_obj('Features Setup', 'Features Setup') - for d in rs: - fs.doc.fields[d[0]] = 1 - fs.doc.save() - fs.validate() diff --git a/patches/jan_mar_2012/pos_setting_patch.py b/patches/jan_mar_2012/pos_setting_patch.py deleted file mode 100644 index 436f1b9efe..0000000000 --- a/patches/jan_mar_2012/pos_setting_patch.py +++ /dev/null @@ -1,23 +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(): - import webnotes - webnotes.conn.sql("update `tabDocField` set `default` = 1 where fieldname = 'conversion_rate' and parent = 'POS Setting'") - - from webnotes.model import delete_doc - delete_doc('DocType', 'POS Settings') diff --git a/patches/jan_mar_2012/print_hide_totals.py b/patches/jan_mar_2012/print_hide_totals.py deleted file mode 100644 index 02aef92ed5..0000000000 --- a/patches/jan_mar_2012/print_hide_totals.py +++ /dev/null @@ -1,37 +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 -import webnotes - -def execute(): - """ - To Hide Net Total, Grand Total Export and Rounded Total Export on checking print hide - - Uncheck print_hide for fields: - net_total, grand_total_export and rounded_total_export - For DocType(s): - * Sales Invoice - * Sales Order - * Delivery Note - * Quotation - """ - webnotes.conn.sql("""\ - UPDATE tabDocField - SET print_hide = 0 - WHERE fieldname IN ('net_total', 'grand_total_export', 'rounded_total_export') - AND parent IN ('Sales Invoice', 'Sales Order', 'Delivery Note', 'Quotation') - """) diff --git a/patches/jan_mar_2012/production_cleanup.py b/patches/jan_mar_2012/production_cleanup.py deleted file mode 100644 index 4e5134a953..0000000000 --- a/patches/jan_mar_2012/production_cleanup.py +++ /dev/null @@ -1,86 +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(): - import webnotes - from webnotes.modules import reload_doc - from webnotes.model import delete_doc - sql = webnotes.conn.sql - - # Production Planning Tool - #--------------------------------------------------------------- - #delete_doc('DocType', 'Production Plan Item') - #delete_doc('DocType', 'Production Plan Sales Order') - #delete_doc('DocType', 'Production Planning Tool') - sql("delete from `tabDocField` where parent in ('Production Planning Tool', 'Production Plan Item', 'Production Plan Sales Order')") - - reload_doc('production', 'doctype', 'production_planning_tool') - reload_doc('production', 'doctype', 'pp_detail') - reload_doc('production', 'doctype', 'pp_so_detail') - - # Production Order - #--------------------------------------------------------------- - - reload_doc('production', 'doctype', 'production_order') - - sql("""delete from `tabDocField` where parent = 'Production Order' - and (label in ('Material Transfer', 'Backflush', 'Stop Production Order', 'Unstop Production Order') - or fieldname = 'transaction_date') - """) - - - # BOM - #--------------------------------------------------------------- - reload_doc('production', 'doctype', 'bill_of_materials') - reload_doc('production', 'doctype', 'bom_material') - reload_doc('production', 'doctype', 'bom_operation') - reload_doc('production', 'doctype', 'flat_bom_detail') - - #copy values - sql("""update `tabBOM` set rm_cost_as_per = 'Valuation Rate', - raw_material_cost = dir_mat_as_per_mar, total_cost = cost_as_per_mar, costing_date = cost_as_on""") - - sql("update `tabBOM Item` set rate = moving_avg_rate, amount = amount_as_per_mar") - - sql("update `tabBOM Explosion Item` set rate = moving_avg_rate, amount = amount_as_per_mar") - - - - # delete depricated flds from bom - sql(""" delete from `tabDocField` where parent = 'BOM' - and ( - label in ('TreeView1', 'Set as Default BOM', 'Activate BOM', 'Inactivate BOM') - or fieldname in ('cost_as_per_mar', 'cost_as_per_lpr', 'cost_as_per_sr', 'cost_as_on', - 'dir_mat_as_per_mar', 'dir_mat_as_per_lpr', 'dir_mat_as_per_sr') - ) - """) - - # delete depricated flds from bom operation - sql("delete from `tabDocField` where parent = 'BOM Operation' and fieldname in ('details', 'workstation_capacity')") - - # delete depricated flds from bom material - sql("""delete from `tabDocField` where parent = 'BOM Item' - and fieldname in ('dir_mat_as_per_mar', 'dir_mat_as_per_sr', 'dir_mat_as_per_lpr', 'operating_cost', 'value_as_per_mar', - 'value_as_per_sr', 'value_as_per_lpr', 'moving_avg_rate', 'standard_rate', 'last_purchase_rate', 'amount_as_per_sr', - 'amount_as_per_lpr', 'amount_as_per_mar') - """) - - # delete depricated flds from flat bom - sql("""delete from tabDocField where parent = 'BOM Explosion Item' - and fieldname in ('moving_avg_rate', 'standard_rate', 'last_purchase_rate', 'amount_as_per_mar', - 'amount_as_per_sr', 'amount_as_per_lpr', 'flat_bom_no', 'bom_mat_no', 'is_pro_applicable') - """) diff --git a/patches/jan_mar_2012/reload_doctype.py b/patches/jan_mar_2012/reload_doctype.py deleted file mode 100644 index f05ee765a1..0000000000 --- a/patches/jan_mar_2012/reload_doctype.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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('core', 'doctype', 'doctype') diff --git a/patches/jan_mar_2012/reload_item.py b/patches/jan_mar_2012/reload_item.py deleted file mode 100644 index 47800a2893..0000000000 --- a/patches/jan_mar_2012/reload_item.py +++ /dev/null @@ -1,23 +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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('stock', 'doctype', 'item') - - webnotes.conn.sql("update `tabItem` set re_order_qty = min_order_qty") diff --git a/patches/jan_mar_2012/reload_mapper.py b/patches/jan_mar_2012/reload_mapper.py deleted file mode 100644 index 146747c4d7..0000000000 --- a/patches/jan_mar_2012/reload_mapper.py +++ /dev/null @@ -1,10 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.modules import reload_doc - - reload_doc('stock', 'DocType Mapper', 'Sales Order-Delivery Note') - reload_doc('accounts', 'DocType Mapper', 'Sales Order-Sales Invoice') - reload_doc('accounts', 'DocType Mapper', 'Delivery Note-Sales Invoice') - - webnotes.conn.sql("delete from `tabField Mapper Detail` where parent = 'Sales Order-Delivery Note' and from_field = 'basic_rate' and to_field = 'basic_rate'") diff --git a/patches/jan_mar_2012/reload_po_pr_mapper.py b/patches/jan_mar_2012/reload_po_pr_mapper.py deleted file mode 100644 index 6bed3b1854..0000000000 --- a/patches/jan_mar_2012/reload_po_pr_mapper.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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt') diff --git a/patches/jan_mar_2012/reload_quote.py b/patches/jan_mar_2012/reload_quote.py deleted file mode 100644 index 4d23f233c0..0000000000 --- a/patches/jan_mar_2012/reload_quote.py +++ /dev/null @@ -1,5 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('selling', 'doctype', 'quotation') diff --git a/patches/jan_mar_2012/reload_table.py b/patches/jan_mar_2012/reload_table.py deleted file mode 100644 index 1bd48735de..0000000000 --- a/patches/jan_mar_2012/reload_table.py +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import unicode_literals -def execute(): - pass - diff --git a/patches/jan_mar_2012/remove_archive.py b/patches/jan_mar_2012/remove_archive.py deleted file mode 100644 index 43bb11146e..0000000000 --- a/patches/jan_mar_2012/remove_archive.py +++ /dev/null @@ -1,41 +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 . - -# TODO take backup before running this patch -from __future__ import unicode_literals -def execute(): - """ - * Restore archived data from arc tables - * Drop arc tables - """ - import webnotes - from webnotes.utils import archive - arc_tables = webnotes.conn.sql('show tables like "arc%"') - try: - webnotes.conn.auto_commit_on_many_writes = 1 - for tab in arc_tables: - tab = tab[0] - dt = tab[3:] - res = webnotes.conn.sql("SELECT name FROM `%s`" % tab) - for dn in res: - archive.archive_doc(dt, dn[0], restore=1) - except Exception, e: - raise e - else: - webnotes.conn.commit() - for tab in arc_tables: - webnotes.conn.sql("DROP TABLE `%s`" % tab[0]) - webnotes.conn.begin() diff --git a/patches/jan_mar_2012/remove_get_tds_button.py b/patches/jan_mar_2012/remove_get_tds_button.py deleted file mode 100644 index 9d254c35d8..0000000000 --- a/patches/jan_mar_2012/remove_get_tds_button.py +++ /dev/null @@ -1,31 +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(): - """ - Remove One Get TDS button, which is appearing twice in JV - """ - import webnotes - webnotes.conn.sql(""" - DELETE from `tabDocField` - WHERE parent='Journal Voucher' - AND label='Get TDS' - AND fieldtype='Button' - """) - - from webnotes.modules import reload_doc - reload_doc('accounts', 'doctype', 'journal_voucher') diff --git a/patches/jan_mar_2012/remove_series_defval.py b/patches/jan_mar_2012/remove_series_defval.py deleted file mode 100644 index 84117cf8aa..0000000000 --- a/patches/jan_mar_2012/remove_series_defval.py +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - webnotes.conn.sql("update `tabDocField` set `default`='' where parent = 'Sales Invoice' and fieldname = 'naming_series' and `default` = 'INV'") diff --git a/patches/jan_mar_2012/rename_dt.py b/patches/jan_mar_2012/rename_dt.py deleted file mode 100644 index c163b49631..0000000000 --- a/patches/jan_mar_2012/rename_dt.py +++ /dev/null @@ -1,436 +0,0 @@ -from __future__ import unicode_literals -import webnotes -import conf -import webnotes.model -from wnf import replace_code -from termcolor import colored -from webnotes.modules import reload_doc -from webnotes.utils import make_esc -import os - -def execute1(): - #rendt = get_dt_to_be_renamed() - #rename_dt_files(rendt) - #update_local_file_system() - replace_labels_with_fieldnames() - -def execute(): - - #--------------------------------------------------- - # doctype renaming - rendt = get_dt_to_be_renamed() - # Rename dt in db - rename_in_db(rendt, 'DocType', 1) - # Upadte dt in records - update_dt_in_records(rendt) - - #--------------------------------------------------- - # Dt Mapper renaming - ren_mapper = get_mapper_to_be_renamed() - # Rename mapper in db - rename_in_db(ren_mapper, 'DocType Mapper', 0) - - #--------------------------------------------------- - # GL Mapper renaming - gl_mapper = {'Receivable Voucher': 'Sales Invoice', 'Payable Voucher': 'Purchase Invoice'} - rename_in_db(gl_mapper, 'GL Mapper', 0) - - - #--------------------------------------------------- - # remove dt label - webnotes.conn.sql("""delete from `tabDocType Label` where name in ('Ticket', 'Receivable Voucher', - 'QA Inspection Report', 'Payable Voucher', 'Manage Account', 'Indent', 'DocLayer')""") - - #--------------------------------------------------- - # Reload mapper from file - for d in ren_mapper: - mod = '_'.join(webnotes.conn.sql("select module from `tabDocType Mapper` where name = %s", - ren_mapper[d])[0][0].lower().split()) - reload_doc(mod, 'DocType Mapper', ren_mapper[d]) - - delete_search_criteria() - change_report_module() - - # reload custom search criteria - #for d in webnotes.conn.sql("""select name, module from - # `tabSearch Criteria` where ifnull(standard, 'No') = 'Yes' and ifnull(disabled, 0) = 0"""): - # - for path, folders, files in os.walk(conf.modules_path): - if not path.endswith('search_criteria'): continue - module = path.split(os.sep)[-2] - for sc in folders: - try: - reload_doc(module, 'search_criteria', sc) - print module, sc - except Exception, e: - print "did not reload: " + str(d) - - webnotes.conn.sql("""DELETE FROM `tabPrint Format` - WHERE name IN ('Delivery Note Format', 'Purchase Order Format', - 'Quotation Format', 'Receivable Voucher Format', 'Sales Order', - 'SalesInvoiceModern_test', 'SalesInvoiceStdNew', - 'Service Order Format', 'Service Quotation Format')""") - - # reload custom print format - for d in webnotes.conn.sql("""select name, module from `tabPrint Format` - where ifnull(standard, 'No') = 'Yes'"""): - try: - reload_doc(d[1], 'Print Format', d[0]) - except Exception, e: - print "did not reload: " + str(d) - - # Reload GL Mapper - for d in webnotes.conn.sql("select name from `tabGL Mapper`"): - reload_doc('accounts', 'GL Mapper', d[0]) - reload_doc('accounts', 'GL Mapper', 'Purchase Invoice with write off') - - webnotes.conn.sql("update `tabDocType` set module = 'Utilities' where module = 'Knowledge Base'") - webnotes.conn.sql("update `tabPage` set module = 'Utilities' where module = 'Knowledge Base'") - - - -def delete_search_criteria(): - webnotes.conn.sql("""DELETE FROM `tabSearch Criteria` - WHERE name IN ('', 'bills-to_be_paid', - 'bills-to_be_submitted', 'cenvat_credit_-_input_or_capital_goods', - 'appraisal_custom', 'custom_test', 'custom_test1', 'delivery_note-to_be_billed', - 'delivery_note-to_be_submitted', 'delivery_notes', - 'employee_leave_balance_report', 'flat_bom_report', - 'general_ledger1', 'lead_interested', - 'payables_-_as_on_outstanding', 'periodical_budget_report', - 'projectwise_delivered_qty_and_costs_as_per_purchase_cost', - 'projectwise_pending_qty_and_costs_as_per_purchase_cost', 'sales', - 'sales_order1', 'sales_order_pending_items', - 'territory_wise_sales_-_target_vs_actual_', 'test_report', - 'lease_agreement_list', 'lease_monthly_future_installment_inflows', - 'lease_over_due_list', 'lease_overdue_age_wise', - 'lease_receipt_summary_month_wise', 'lease_receipts_client_wise', - 'lease_yearly_future_installment_inflows', - 'monthly_ledger_summary_report', 'payables_-_as_on_outstanding', - 'payment_report', 'progressive_total_excise_duty', - 'service_tax_credit_account_-_inputs', - 'total_amout_collection_for_a_period_-_customerwise', - 'invoices-to_be_submitted', 'invoices-to_receive_payment', - 'opportunity-quotations_to_be_sent', 'purchase_order-to_be_billed', - 'purchase_order-to_be_submitted', - 'purchase_order-to_receive_items', - 'purchase_request-purchase_order_to_be_made', - 'purchase_request-to_be_submitted', - 'sales-order_to_be_submitted', 'sales_order-overdue', - 'sales_order-to_be_billed', 'sales_order-to_be_delivered', - 'sales_order-to_be_submitted', 'task-open', 'appraisal_custom', - 'employee_details', 'employee_in_company_experience', - 'employee_leave_balance_report', 'employeewise_leave_transaction_details', - 'pending_appraisals', 'pending_expense_claims', 'delivery_plan', 'flat_bom_report', - 'dispatch_report', 'projectwise_delivered_qty_and_costs_as_per_purchase_cost', - 'projectwise_pending_qty_and_costs_as_per_purchase_cost', 'custom_test', 'custom_test1', - 'delivery_notes', 'delivery_note_disabled', 'lead', 'lead_interested', 'lead_report', - 'periodic_sales_summary', 'monthly_despatched_trend', 'sales', 'sales_order', - 'sales_order1', 'sales_agentwise_commission', 'test_report', - 'territory_wise_sales_-_target_vs_actual_', - 'pending_po_items_to_bill1', 'pending_po_items_to_receive1', - 'expense_vouchers', 'pending_expense_vouchers', 'shortage_to_indent')""") - - webnotes.conn.sql(""" - DELETE FROM `tabSearch Criteria` - WHERE name IN ('monthly_transaction_summary', 'trend_analyzer', - 'yearly_transaction_summary', 'invoices-overdue', 'lead-to_follow_up', - 'opportunity-to_follow_up', 'serial_no-amc_expiring_this_month', - 'serial_no-warranty_expiring_this_month') - AND IFNULL(standard, 'No') = 'Yes' - """) - -def change_report_module(): - reports = {'itemwise_receipt_details': 'Stock'} - for k in reports: - webnotes.conn.sql("update `tabSearch Criteria` set module = %s where name = %s", (reports[k], k)) - -def rename_in_db(ren_data, data_type, is_doctype): - for d in ren_data: - print colored('Renaming... ' + d + ' --> '+ ren_data[d], 'yellow') - #rename - try: - webnotes.model.rename(data_type, d, ren_data[d], is_doctype) - except Exception, e: - if e.args[0]!=1050: - raise e - else: - print e - pass - - -def update_dt_in_records(rendt): - for d in rendt: - # Feed, property setter, search criteria, gl mapper, form 16A, naming series options, doclayer - dodtype is not mentioed in options - dt_list = webnotes.conn.sql("""select t1.parent, t1.fieldname from - tabDocField t1, tabDocType t2 where t1.parent = t2.name and - t1.fieldname in ('dt', 'doctype', 'doc_type', 'dt_type') and - ifnull(t1.options, '') = '' and ifnull(t2.issingle, 0) = 0 and - t1.parent in ('Custom Field', 'Custom Script', 'Property Setter')""") - for dt in dt_list: - webnotes.conn.sql("update `tab%s` set %s = replace(%s, '%s', '%s') where %s = '%s'" % (dt[0], dt[1], dt[1], d, rendt[d], dt[1], d)) - - # gl mapper, gl entry - webnotes.conn.sql("update `tabGL Mapper Detail` set against_voucher_type = replace(against_voucher_type, '%s', '%s') where against_voucher_type like '%%%s%%'" % (d, rendt[d], d)) - webnotes.conn.sql("update `tabGL Entry` set against_voucher_type = replace(against_voucher_type, '%s', '%s') where against_voucher_type = '%s'" % (d, rendt[d], d)) - webnotes.conn.sql("update `tabGL Entry` set voucher_type = replace(voucher_type, '%s', '%s') where voucher_type = '%s'" % (d, rendt[d], d)) - - # Stock ledger entry - webnotes.conn.sql("update `tabStock Ledger Entry` set voucher_type = replace(voucher_type, '%s', '%s') where voucher_type = '%s'" % (d, rendt[d], d)) - - # Custom fld: options - webnotes.conn.sql("update `tabCustom Field` set options = replace(options, %s, %s) where fieldtype in ('Link', 'Select', 'Table')", (d, rendt[d])) - - #Property Setter: value (if property=options) - webnotes.conn.sql("update `tabProperty Setter` set value = replace(value, %s, %s) where property = 'Options'", (d, rendt[d])) - - # custom script: script - webnotes.conn.sql("update `tabCustom Script` set script = replace(script, %s, %s)", (d, rendt[d])) - - # print format: html - webnotes.conn.sql("update `tabPrint Format` set html = replace(html, %s, %s) where ifnull(standard, 'Yes') = 'No'", (d, rendt[d])) - - # custom report: doc_type, filters, columns, parent_doc_type, add_cond, add_col, add_tab, - # dis_filters, group_by, sort_by, report_script, server_script, custom_query - 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) - where - ifnull(standard, 'Yes') = 'No' - """, (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], )) - - - - -def get_dt_to_be_renamed(): - 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', - } - return rendt - - -def get_mapper_to_be_renamed(): - ren_map = { - 'Sales Order-Receivable Voucher' : 'Sales Order-Sales Invoice', - 'Sales Order-Indent' : 'Sales Order-Purchase Request', - 'Receivable Voucher-Delivery Note' : 'Sales Invoice-Delivery Note', - 'Purchase Receipt-Payable Voucher' : 'Purchase Receipt-Purchase Invoice', - 'Purchase Order-Payable Voucher' : 'Purchase Order-Purchase Invoice', - 'Project-Receivable Voucher' : 'Project-Sales Invoice', - 'Lead-Enquiry' : 'Lead-Opportunity', - 'KRA Template-Appraisal' : 'Appraisal Template-Appraisal', - 'Indent-Purchase Order' : 'Purchase Request-Purchase Order', - 'Enquiry-Quotation' : 'Opportunity-Quotation', - 'Delivery Note-Receivable Voucher' : 'Delivery Note-Sales Invoice' - } - return ren_map - - - - -#-------------------------------------------------------------------------------------------------------- - - -def update_local_file_system(): - """ RUN ONLY IN LOCAL""" - - # doctype renaming - rendt = get_dt_to_be_renamed() - - # replace dt in js/py file - update_file_content(rendt) - # git mv - rename_dt_files(rendt) - - - # Mapper renaming - ren_mapper = get_mapper_to_be_renamed() - - rename_mapper_files(ren_mapper) - - os.system('git mv erpnext/accounts/GL\ Mapper/Payable\ Voucher erpnext/accounts/GL\ Mapper/Purchase\ Invoice') - os.system('git mv erpnext/accounts/GL\ Mapper/Purchase\ Invoice/Payable\ Voucher.txt erpnext/accounts/GL\ Mapper/Purchase\ Invoice/Purchase\ Invoice.txt') - os.system('git mv erpnext/accounts/GL\ Mapper/Receivable\ Voucher erpnext/accounts/GL\ Mapper/Sales\ Invoice') - os.system('git mv erpnext/accounts/GL\ Mapper/Sales\ Invoice/Receivable\ Voucher.txt erpnext/accounts/GL\ Mapper/Sales\ Invoice/Sales\ Invoice.txt') - - # git rm production dt mapper - os.system('git rm -r erpnext/production/DocType\ Mapper/') - - - -def update_file_content(rendt): - for d in rendt: - print colored('Renaming... ' + d + ' --> '+ rendt[d], 'yellow') - for extn in ['js', 'py', 'txt', 'html']: - res = replace_code('/var/www/erpnext/', d, rendt[d], extn) - if res == 'skip': - break - - -def rename_dt_files(rendt): - for d in rendt: - mod = webnotes.conn.sql("select module from tabDocType where name = %s", rendt[d])[0][0] - if mod == 'Core': - os.chdir('/var/www/erpnext/lib/') - path = 'py/core/doctype/' - else: - os.chdir('/var/www/erpnext/') - path = 'erpnext/' + '_'.join(mod.lower().split()) + '/doctype/' - old = '_'.join(d.lower().split()) - new = '_'.join(rendt[d].lower().split()) - - print 'git mv ' + path + old + ' ' + path + new - # rename old dir - os.system('git mv ' + path + old + ' ' + path + new) - - # rename all files in that dir - for extn in ['js', 'py', 'txt', 'html']: - if os.path.exists(path + new + '/'+ old + '.' +extn): - os.system('git mv ' + path + new + '/'+ old + '.' +extn + ' ' + path + new + '/' + new + '.' +extn) - print 'git mv ' + path + new + '/'+ old + '.' +extn + ' ' + path + new + '/' + new + '.' +extn - - -def rename_mapper_files(ren_mapper): - for d in ren_mapper: - # module - mod = '_'.join(webnotes.conn.sql("select module from `tabDocType Mapper` where name = %s", ren_mapper[d])[0][0].lower().split()) - path = 'erpnext/' + mod + '/DocType Mapper/' - - # rename old dir - esc = make_esc('$ ') - os.system('git mv ' + esc(path + d) + ' ' + esc(path + ren_mapper[d])) - print 'git mv ' + esc(path + d) + ' ' + esc(path + ren_mapper[d]) - os.system('git mv ' + esc(path + ren_mapper[d] + '/'+ d + '.txt') - + ' ' + esc(path + ren_mapper[d] + '/' + ren_mapper[d] + '.txt')) - print 'git mv ' + esc(path + ren_mapper[d] + '/'+ d + '.txt') + ' ' + esc(path + ren_mapper[d] + '/' + ren_mapper[d] + '.txt') - - -def replace_labels_with_fieldnames(): - """ - This is used for replacing instances like cur_frm.cscript['LABEL'] with - cur_frm.cscript.FIELDNAME in js files - """ - doctype = {} - doctype.update(prepare_dict_of_label_fieldname('/var/www/erpnext/erpnext/')) - doctype.update(prepare_dict_of_label_fieldname('/var/www/erpnext/lib/py')) - #print doctype - - for doc in doctype: - label_fieldname = doctype[doc] - for d in label_fieldname: - #label = "cur_frm.cscript['%s']" % d - #fieldname = "cur_frm.cscript.%s" % label_fieldname[d] - label = d - fieldname = label_fieldname[d] - print colored('Changing... ' + doc + ': ' + label + ' --> '+ fieldname, 'yellow') - #res = replace_code('/var/www/erpnext/', label, fieldname, 'js') - res = replace_code('/var/www/erpnext/', label, fieldname, 'js', - 'hide_field\(.*%s' % label) - if res == 'skip': - break - -def prepare_dict_of_label_fieldname(module_path): - from webnotes.model.utils import peval_doclist - from webnotes.model.sync import get_file_path - doctype = {} - for path, folders, files in os.walk(module_path): - if path == module_path: - modules_list = folders - for f in files: - if f.endswith(".txt"): - rel_path = os.path.relpath(path, conf.modules_path) - path_tuple = rel_path.split(os.sep) - if (len(path_tuple)==3 and path_tuple[0] in modules_list and - path_tuple[1] == 'doctype'): - file_name = f[:-4] - with open(get_file_path(path_tuple[0], file_name), 'r') as fn: - doclist = peval_doclist(fn.read()) - doctype[file_name] = dict(([d.get('label'),d.get('fieldname')] \ - for d in doclist if d.get('doctype')=='DocField')) - return doctype diff --git a/patches/jan_mar_2012/serial_no_add_opt.py b/patches/jan_mar_2012/serial_no_add_opt.py deleted file mode 100644 index 7693fae0ad..0000000000 --- a/patches/jan_mar_2012/serial_no_add_opt.py +++ /dev/null @@ -1,35 +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(): - import webnotes - opts = webnotes.conn.sql("""\ - SELECT options FROM `tabDocField` - WHERE parent='Serial No' AND fieldname='status' AND - fieldtype='Select'""") - if opts and opts[0][0]: - opt_list = opts[0][0].split("\n") - if not "Purchase Returned" in opt_list: - webnotes.conn.sql(""" - UPDATE `tabDocField` SET options=%s - WHERE parent='Serial No' AND fieldname='status' AND - fieldtype='Select'""", "\n".join(opt_list + ["Purchase Returned"])) - webnotes.conn.commit() - webnotes.conn.begin() - - from webnotes.modules import reload_doc - reload_doc('stock', 'doctype', 'serial_no') diff --git a/patches/jan_mar_2012/stable_branch_shift_09_01_12.py b/patches/jan_mar_2012/stable_branch_shift_09_01_12.py deleted file mode 100644 index 177eb81472..0000000000 --- a/patches/jan_mar_2012/stable_branch_shift_09_01_12.py +++ /dev/null @@ -1,55 +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 -import webnotes -from webnotes.modules import reload_doc - -def execute(): - """ - * Reload Sales Taxes and Charges - * Reload Support Ticket - * Run Install Print Format Patch - * Reload Customize Form - """ - reload_doc('accounts', 'doctype', 'rv_tax_detail') - reload_doc('support', 'doctype', 'support_ticket') - reload_print_formats() - reload_doc('core', 'doctype', 'doclayer') - -def reload_print_formats(): - """ - Reloads the following print formats: - * Sales Invoice Classic/Modern/Spartan - * Sales Order Classic/Modern/Spartan - * Delivery Note Classic/Modern/Spartan - * Quotation Classic/Modern/Spartan - """ - reload_doc('accounts', 'Print Format', 'Sales Invoice Classic') - reload_doc('accounts', 'Print Format', 'Sales Invoice Modern') - reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan') - - reload_doc('selling', 'Print Format', 'Sales Order Classic') - reload_doc('selling', 'Print Format', 'Sales Order Modern') - reload_doc('selling', 'Print Format', 'Sales Order Spartan') - - reload_doc('selling', 'Print Format', 'Quotation Classic') - reload_doc('selling', 'Print Format', 'Quotation Modern') - reload_doc('selling', 'Print Format', 'Quotation Spartan') - - reload_doc('stock', 'Print Format', 'Delivery Note Classic') - reload_doc('stock', 'Print Format', 'Delivery Note Modern') - reload_doc('stock', 'Print Format', 'Delivery Note Spartan') diff --git a/patches/jan_mar_2012/stock_entry_others_patch.py b/patches/jan_mar_2012/stock_entry_others_patch.py deleted file mode 100644 index 03cc105e9c..0000000000 --- a/patches/jan_mar_2012/stock_entry_others_patch.py +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('stock', 'doctype', 'stock_entry') - - webnotes.conn.sql("update `tabDocField` set options = concat(options, '\nOthers') where fieldname = 'purpose' and parent = 'Stock Entry'") diff --git a/patches/jan_mar_2012/subcon_default_val.py b/patches/jan_mar_2012/subcon_default_val.py deleted file mode 100644 index 2d0891d3e2..0000000000 --- a/patches/jan_mar_2012/subcon_default_val.py +++ /dev/null @@ -1,24 +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(): - import webnotes - webnotes.conn.sql(""" - update `tabDocField` set `default` = 'No' - where parent in ('Purchase Order', 'Purchase Receipt') - and fieldname = 'is_subcontracted' - """) diff --git a/patches/jan_mar_2012/sync_ref_db.py b/patches/jan_mar_2012/sync_ref_db.py deleted file mode 100644 index 5af1e54275..0000000000 --- a/patches/jan_mar_2012/sync_ref_db.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import unicode_literals -import webnotes -sql = webnotes.conn.sql -from webnotes.model import delete_doc - -def execute(): - del_rec = { - 'DocType' : ['Update Series', 'File', 'File Browser Control', 'File Group', - 'Tag Detail', 'DocType Property Setter', 'Company Group', 'Widget Control', - 'Update Delivery Date Detail', 'Update Delivery Date', - 'Tag Detail', 'Supplier rating', 'Stylesheet', 'Question Tag', - 'PRO PP Detail', 'PRO Detail', 'PPW Detail', 'PF Detail', - 'Personalize', 'Patch Util', 'Page Template', 'Module Def Role', - 'Module Def Item', 'File Group', 'File Browser Control', 'File', - 'Educational Qualifications', 'Earn Deduction Detail', - 'DocType Property Setter', 'Contact Detail', 'BOM Report Detail', - 'BOM Replace Utility Detail', 'BOM Replace Utility', - 'Absent Days Detail', 'Activity Dashboard Control', 'Raw Materials Supplied', - 'Setup Wizard Control', 'Company Group', 'Lease Agreement', 'Lease Installment', - 'Terms and Conditions', 'Time Sheet', 'Time Sheet Detail', 'Naming Series Options', - 'Invest 80 Declaration Detail', 'IT Checklist', 'Chapter VI A Detail', 'Declaration Detail', - 'Personalize', 'Salary Slip Control Panel', 'Question Control' - ], - 'Page' : ['File Browser', 'Bill of Materials', 'question-view'], - 'DocType Mapper': ['Production Forecast-Production Planning Tool', 'Production Forecast-Production Plan', 'Sales Order-Production Plan'], - } - - for d in del_rec: - for r in del_rec[d]: - print 'Deleted', d, ' - ', r - if d=='DocType': - sql("delete from tabFeed where doc_type=%s", r) - delete_doc(d, r) - - sql("delete from tabDocField where label='Repair Purchase Request' and parent = 'Purchase Request'") - - drop_tables() - - -def drop_tables(): - webnotes.conn.commit() - from webnotes.model.db_schema import remove_all_foreign_keys - remove_all_foreign_keys() - count = 0 - tab_list = sql("SHOW TABLES") - for tab in tab_list: - if tab[0].startswith('_') or tab[0] in ('tabSingles', 'tabSessions', 'tabSeries'): continue - res = sql("SELECT COUNT(*) FROM `tabDocType` WHERE name = %s", tab[0][3:]) - if not res[0][0]: - count += 1 - print tab[0] - sql("DROP TABLE `%s`" % tab[0]) - print count - webnotes.conn.begin() diff --git a/patches/jan_mar_2012/update_purpose_se.py b/patches/jan_mar_2012/update_purpose_se.py deleted file mode 100644 index 721ec46f3a..0000000000 --- a/patches/jan_mar_2012/update_purpose_se.py +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - webnotes.conn.sql("update `tabDocField` set options = replace(options, 'Others', 'Other') where fieldname = 'purpose' and parent = 'Stock Entry'") diff --git a/patches/jan_mar_2012/update_se_fld_options.py b/patches/jan_mar_2012/update_se_fld_options.py deleted file mode 100644 index 61512d3f23..0000000000 --- a/patches/jan_mar_2012/update_se_fld_options.py +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - webnotes.conn.sql("update `tabDocField` set options = 'BOM' where fieldname = 'bom_no' and parent = 'Stock Entry'") - - from webnotes.modules import reload_doc - reload_doc('stock', 'doctype', 'stock_entry') diff --git a/patches/jan_mar_2012/update_stockreco_perm.py b/patches/jan_mar_2012/update_stockreco_perm.py deleted file mode 100644 index b5d270fb09..0000000000 --- a/patches/jan_mar_2012/update_stockreco_perm.py +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import unicode_literals -def execute(): - import webnotes - webnotes.conn.sql("update `tabDocPerm` set cancel = 1 where parent = 'Stock Reconciliation' and ifnull(submit, 0) = 1") diff --git a/patches/jan_mar_2012/website/__init__.py b/patches/jan_mar_2012/website/__init__.py deleted file mode 100644 index eb05a23c80..0000000000 --- a/patches/jan_mar_2012/website/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ - -from __future__ import unicode_literals - \ No newline at end of file diff --git a/patches/jan_mar_2012/website/all.py b/patches/jan_mar_2012/website/all.py deleted file mode 100644 index fbb2e9dc2a..0000000000 --- a/patches/jan_mar_2012/website/all.py +++ /dev/null @@ -1,36 +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 -import patches.jan_mar_2012.website.login -import patches.jan_mar_2012.website.feed -import patches.jan_mar_2012.website.website -import patches.jan_mar_2012.website.cleanups -import patches.jan_mar_2012.website.domain_list -import patches.jan_mar_2012.website.file_data_rename -import patches.jan_mar_2012.website.analytics -import patches.jan_mar_2012.website.allow_product_delete - - -def execute(): - patches.jan_mar_2012.website.login.execute() - patches.jan_mar_2012.website.feed.execute() - patches.jan_mar_2012.website.website.execute() - patches.jan_mar_2012.website.cleanups.execute() - patches.jan_mar_2012.website.domain_list.execute() - patches.jan_mar_2012.website.file_data_rename.execute() - patches.jan_mar_2012.website.analytics.execute() - patches.jan_mar_2012.website.allow_product_delete.execute() diff --git a/patches/jan_mar_2012/website/allow_product_delete.py b/patches/jan_mar_2012/website/allow_product_delete.py deleted file mode 100644 index 21dd451698..0000000000 --- a/patches/jan_mar_2012/website/allow_product_delete.py +++ /dev/null @@ -1,25 +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(): - """ - Allow deletion of products - """ - import webnotes - webnotes.conn.sql("""UPDATE `tabDocPerm` SET cancel=1 - WHERE parent='Product' AND role='Website Manager' - AND permlevel=0""") diff --git a/patches/jan_mar_2012/website/analytics.py b/patches/jan_mar_2012/website/analytics.py deleted file mode 100644 index b86c8ce9a8..0000000000 --- a/patches/jan_mar_2012/website/analytics.py +++ /dev/null @@ -1,22 +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(): - from webnotes.modules import reload_doc - reload_doc('website', 'doctype', 'website_settings') - reload_doc('website', 'doctype', 'product_settings') - \ No newline at end of file diff --git a/patches/jan_mar_2012/website/cleanups.py b/patches/jan_mar_2012/website/cleanups.py deleted file mode 100644 index 25cc63a530..0000000000 --- a/patches/jan_mar_2012/website/cleanups.py +++ /dev/null @@ -1,48 +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 -import webnotes - -def execute(): - from webnotes.model import delete_doc - from webnotes.modules import reload_doc - delete_doc("DocType", "SSO Control") - delete_doc("DocType", "WN ERP Client Control") - delete_doc("DocType", "Production Tips Common") - delete_doc("DocType", "DocTrigger") - delete_doc("Page", "Setup Wizard") - - # cleanup control panel - delete_doc("DocType", "Control Panel") - reload_doc("core", "doctype", "control_panel") - - webnotes.conn.sql("""delete from tabSingles - where field like 'startup_%' and doctype='Control Panel'""") - webnotes.conn.sql("""delete from __SessionCache""") - - webnotes.conn.commit() - - # DDLs - # ------------------- - - webnotes.conn.sql("drop table if exists tabDocTrigger") - - try: webnotes.conn.sql("""alter table `tabFile Data` drop column blob_content""") - except: pass - - webnotes.conn.sql("""alter table __PatchLog engine=InnoDB""") - diff --git a/patches/jan_mar_2012/website/domain_list.py b/patches/jan_mar_2012/website/domain_list.py deleted file mode 100644 index bbac836a5d..0000000000 --- a/patches/jan_mar_2012/website/domain_list.py +++ /dev/null @@ -1,39 +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(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('website', 'doctype', 'website_settings') - - res = webnotes.conn.sql("""\ - SELECT name FROM `tabDocPerm` - WHERE parent='Website Settings' AND role='All' AND permlevel=1""") - if not res: - idx = webnotes.conn.sql("""\ - SELECT MAX(idx) FROM `tabDocPerm` - WHERE parent='Website Settings' - """)[0][0] - from webnotes.model.doc import Document - d = Document('DocType', 'Website Settings') - perm = d.addchild('permissions', 'DocPerm') - perm.read = 1 - perm.role = 'All' - perm.permlevel = 1 - perm.idx = idx + 1 - perm.save() - diff --git a/patches/jan_mar_2012/website/feed.py b/patches/jan_mar_2012/website/feed.py deleted file mode 100644 index eae887128e..0000000000 --- a/patches/jan_mar_2012/website/feed.py +++ /dev/null @@ -1,22 +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 -import webnotes -from webnotes.modules import reload_doc - -def execute(): - reload_doc('home', 'doctype', 'feed') \ No newline at end of file diff --git a/patches/jan_mar_2012/website/file_data_rename.py b/patches/jan_mar_2012/website/file_data_rename.py deleted file mode 100644 index 1871a784ec..0000000000 --- a/patches/jan_mar_2012/website/file_data_rename.py +++ /dev/null @@ -1,81 +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 -import webnotes - -def execute(): - """ - * Replace / in names with - in tabFile Data - * Change autoname in DocType File Data to FileData-.##### - * Change FileData/ to FileData- in tabSeries - * In each table containing file_list column, replace / with - in the data of that column - """ - replace_name_in_file_data() - change_autoname_in_tabfile_data() - change_file_data_in_tabseries() - replace_file_list_column_entries() - -def replace_name_in_file_data(): - """ - Change / to - in tabFile Data name column entries - """ - files = webnotes.conn.sql("SELECT name FROM `tabFile Data`") - for f in files: - if "/" in f[0]: - webnotes.conn.sql("UPDATE `tabFile Data` SET name=%s WHERE name=%s", (f[0].replace('/', '-'), f[0])) - - -def change_autoname_in_tabfile_data(): - """ - Change autoname in DocType File Data to FileData-.##### - """ - webnotes.conn.sql("UPDATE `tabDocType` SET autoname='FileData-.#####' WHERE name='File Data'") - - -def change_file_data_in_tabseries(): - """ - Change FileData/ to FileData- in tabSeries - """ - webnotes.conn.sql("UPDATE `tabSeries` SET name='FileData-' WHERE name='FileData/'") - - -def replace_file_list_column_entries(): - """ - In each table containing file_list column, replace / with - in the data of that column - """ - tables = webnotes.conn.sql("SHOW TABLES") - tab_list = [] - for tab in tables: - columns = webnotes.conn.sql("DESC `%s`" % tab[0]) - if 'file_list' in [c[0] for c in columns]: - tab_list.append(tab[0]) - - for tab in tab_list: - data = webnotes.conn.sql("SELECT name, file_list FROM `%s`" % tab) - for name, file_list in data: - if file_list and "/" in file_list: - webnotes.conn.sql("UPDATE `%s` SET file_list='%s' WHERE name='%s'" \ - % (tab, file_list.replace('/', '-'), name)) - - singles = webnotes.conn.sql("""SELECT doctype, value FROM `tabSingles` - WHERE field='file_list'""") - for doctype, file_list in singles: - if file_list and "/" in file_list: - webnotes.conn.sql("""UPDATE `tabSingles` SET value='%s' - WHERE doctype='%s' AND field='file_list'""" - % (file_list.replace('/', '-'), doctype)) - diff --git a/patches/jan_mar_2012/website/getfile_rename.py b/patches/jan_mar_2012/website/getfile_rename.py deleted file mode 100644 index 58f70c573a..0000000000 --- a/patches/jan_mar_2012/website/getfile_rename.py +++ /dev/null @@ -1,67 +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 -import webnotes - -def execute(): - """rename from getfle""" - l = [ - ('Quotation Item', 'description'), - ('Sales Order Item', 'description'), - ('Delivery Note Item', 'description'), - ('Sales Invoice Item', 'description'), - ('Item', 'description_html'), - ('Letter Head', 'content') - ] - - import re - - for table in l: - for item in webnotes.conn.sql("""select name, %s from `tab%s` - where %s like '%s'""" % (table[1], table[0], table[1], '%cgi-bin/getfile.cgi%')): - txt = re.sub('\&acx=[^"\']*', '', item[1])\ - .replace('cgi-bin/getfile.cgi?name=', 'files/')\ - .replace('FileData/', 'FileData-') - - txt = get_file_id(txt) - - webnotes.conn.sql("""update `tab%s` set %s=%s where name=%s""" % \ - (table[0], table[1], '%s', '%s'), (txt, item[0])) - - # control panel, client name - txt = webnotes.conn.get_value('Control Panel',None,'client_name') - if txt: - txt = get_file_id(txt) - webnotes.conn.set_value('Control Panel', None, 'client_name', txt.replace('index.cgi?cmd=get_file&fname=', 'files/')) - -def get_file_id(txt): - """old file links may be from fileid or filename""" - import re - match = re.search('files/([^"\']*)', txt) - - if not match: - print txt - return txt - - fname = match.groups()[0] - if not fname.startswith('FileData'): - fid = webnotes.conn.sql("""select name from `tabFile Data` - where file_name=%s""", fname) - if fid: - fid = fid[0][0].replace('/', '-') - txt = txt.replace(fname, fid) - return txt diff --git a/patches/jan_mar_2012/website/login.py b/patches/jan_mar_2012/website/login.py deleted file mode 100644 index dfd8517e9e..0000000000 --- a/patches/jan_mar_2012/website/login.py +++ /dev/null @@ -1,36 +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 -import webnotes -from webnotes.model.doc import Document -from webnotes.modules import reload_doc - -def execute(): - add_default_home_page() - reload_doc('setup','doctype','manage_account') - - -def add_default_home_page(): - if not webnotes.conn.sql("""select name from `tabDefault Home Page` - where role='Guest' and home_page='Login Page'"""): - d = Document('Default Home Page') - d.parent = 'Control Panel' - d.parenttype = 'Control Panel' - d.parentfield = 'default_home_pages' - d.role = 'Guest' - d.home_page = 'Login Page' - d.save(1) diff --git a/patches/jan_mar_2012/website/website.py b/patches/jan_mar_2012/website/website.py deleted file mode 100644 index 8c154caff4..0000000000 --- a/patches/jan_mar_2012/website/website.py +++ /dev/null @@ -1,89 +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 . - -# website patch - -from __future__ import unicode_literals -import webnotes -from webnotes.model.doc import Document - -def execute(): - add_website_manager() - from webnotes.modules import reload_doc - from webnotes.model import delete_doc - - # cleanup page - delete_doc("DocType", "Page") - reload_doc("core", "doctype", "page") - - reload_doc('setup', 'doctype', 'item_group') - delete_doc('Website', 'Module Def', 'Website') - reload_doc('website', 'Module Def', 'Website') - reload_doc('website', 'Role', 'Website Manager') - reload_doc('website', 'Role', 'Blogger') - - webnotes.conn.sql("""delete from `tabModule Def Role` where parent='Website'""") - d = Document('Module Def Role') - d.parent = 'Website' - d.role = 'Website Manager' - d.save() - - reload_doc('website', 'doctype', 'about_us_settings') - reload_doc('website', 'doctype', 'about_us_team') - reload_doc('website', 'doctype', 'blog') - reload_doc('website', 'doctype', 'contact_us_settings') - reload_doc('website', 'doctype', 'product') - reload_doc('website', 'doctype', 'product_group') - reload_doc('website', 'doctype', 'products_settings') - reload_doc('website', 'doctype', 'related_page') - reload_doc('website', 'doctype', 'style_settings') - reload_doc('website', 'doctype', 'top_bar_item') - reload_doc('website', 'doctype', 'web_page') - reload_doc('website', 'doctype', 'website_settings') - - reload_doc('website', 'page', 'about') - reload_doc('website', 'page', 'blog') - reload_doc('website', 'page', 'contact') - reload_doc('website', 'page', 'products') - reload_doc('website', 'page', 'unsubscribe') - - create_home_page() - add_website_manager() - -def create_home_page(): - """create a dummy home page""" - from webnotes.model.code import get_obj - if not webnotes.conn.sql("""select name from `tabWeb Page` where name='home'"""): - d = Document('Web Page') - d.title = 'Home' - d.head_section = "

Your Headline

" - d.main_section = "

Some introduction about your company

" - d.side_section = "

Links to other pages

" - d.save() - obj = get_obj(doc = d) - obj.validate() - obj.doc.save() - -def add_website_manager(): - """add website manager to system manager""" - for i in webnotes.conn.sql("""select distinct parent from tabUserRole - where role='System Manager'"""): - if not webnotes.conn.sql("""select parent from tabUserRole - where role='Website Manager' and parent=%s""", i[0]): - d = Document('UserRole') - d.parent = i[0] - d.role = 'Website Manager' - d.save(1) diff --git a/patches/patch_list.py b/patches/patch_list.py index 4f64dff8c8..de35070069 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -16,213 +16,6 @@ from __future__ import unicode_literals patch_list = [ - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'stable_branch_shift_09_01_12', - 'description': 'Various Reloads for shifting branch from master to stable' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'print_hide_totals', - 'description': 'Uncheck print_hide for RV, SO, DN and Quotation' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'rename_doctype_indent', - 'description': 'Add DocType Label: Purchase Request to Purchase Requisition' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'production_cleanup', - 'description': 'Major changes in production module, almost rewrited the entire code' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'jan_production_patches', - 'description': 'Fixes after Major changes in production module' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'allocated_to_profile', - 'description': """Change Options to "Profile" for fieldname "allocated_to" - as this is giving improper values in Permission Engine""" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'remove_get_tds_button', - 'description': "Remove One Get TDS button, which is appearing twice in JV" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'customer_address_contact_patch', - 'description': "Install Customer Address Contact report and run patches regarding primary address and contact" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'doclabel_in_doclayer', - 'description': "Show DocType Labels instead of DocType names in Customize Form View" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'email_settings_reload', - 'description': "Change type of mail_port field to Int and reload email_settings doctype" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'serial_no_add_opt', - 'description': "Add option 'Purchase Returned' to Serial No status field" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'cancel_purchase_returned', - 'description': "Set docstatus = 2 where status = 'Purchase Returned' for serial no" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'deploy_packing_slip', - 'description': "Delete old packing slip fields & print format & deploy new doctypes related to Packing Slip" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'map_conversion_rate', - 'description': "Maps conversion rate in doctype mappers PO-PR and PO-PV" - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'account_type_patch', - 'description': 'mentioed account type for some tax accounts' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'subcon_default_val', - 'description': 'Default value of is_subcontracted in PO, PR is No' - }, - { - 'patch_module': 'patches.jan_mar_2012.website', - 'patch_file': 'all', - 'description': 'Run all website related patches' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'remove_archive', - 'description': 'unarchive all records and drop archive tables' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'no_copy_patch', - 'description': 'insert after fld in custom fld should be no_copy' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'reload_item', - 'description': 'reload item' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'fix_packing_slip', - 'description': 'Update Mapper Delivery Note-Packing Slip' - }, - { - 'patch_module': 'patches.jan_mar_2012.apps', - 'patch_file': 'todo_item', - 'description': 'Reloads todo item' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'convert_tables_to_utf8', - 'description': 'Convert tables to UTF-8' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'pending_patches', - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'pos_setting_patch', - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'reload_doctype', - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'reload_po_pr_mapper', - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'delete_pur_of_service', - 'description': 'Deletes purpose of service' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'navupdate', - 'description': 'New Navigation Pages' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'label_cleanup', - 'description': 'Remove extra fields and new dynamic labels' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'add_roles_to_admin', - 'description': 'Add Roles to Administrator' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'dt_map_fix', - 'description': 'removed transaction date from dt_mapper' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'reload_table', - 'description': 'Relaod all item table: fld order changes' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'remove_series_defval', - 'description': 'Remove rv series default value' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'update_stockreco_perm', - 'description': 'Update stock reco permission' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'stock_entry_others_patch', - 'description': 'new purpose others in stock entry' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'reload_quote', - 'description': 'reload quote: organization fld added' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'update_purpose_se', - 'description': 'Purpose SE: Others to Other' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'update_se_fld_options', - 'description': 'Purpose SE: Others to Other' - }, - { - 'patch_module': 'patches.mar_2012', - 'patch_file': 'pos_invoice_fix', - 'description': 'Reload POS Invoice' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'reload_mapper', - 'description': 'SO-DN, SO-Rv, DN-RV' - }, - { - 'patch_module': 'patches.jan_mar_2012', - 'patch_file': 'mapper_fix', - 'description': 'DN-RV duplicate table entry' - }, { 'patch_module': 'patches.mar_2012', 'patch_file': 'so_rv_mapper_fix', diff --git a/production/__init__.py b/production/__init__.py index 9ca5e3bf87..07594ad89c 100644 --- a/production/__init__.py +++ b/production/__init__.py @@ -1,5 +1,5 @@ from __future__ import unicode_literals install_docs = [ - {"doctype":"Role", "role_name":"Production Manager", "name":"Production Manager"}, - {"doctype":"Role", "role_name":"Production User", "name":"Production User"}, + {"doctype":"Role", "role_name":"Manufacturing Manager", "name":"Manufacturing Manager"}, + {"doctype":"Role", "role_name":"Manufacturing User", "name":"Manufacturing User"}, ] diff --git a/production/doctype/bom/bom.txt b/production/doctype/bom/bom.txt index 58cb5cb01e..893c9f562e 100644 --- a/production/doctype/bom/bom.txt +++ b/production/doctype/bom/bom.txt @@ -4,14 +4,14 @@ "docstatus": 0, "creation": "2012-07-03 13:30:03", "modified_by": "Administrator", - "modified": "2012-12-03 13:29:26" + "modified": "2012-12-10 18:30:00" }, { "istable": 0, "in_create": 0, "allow_print": 0, "search_fields": "item", - "module": "Production", + "module": "Manufacturing", "document_type": "Master", "allow_attach": 0, "read_only": 0, @@ -321,13 +321,13 @@ "doctype": "DocPerm", "submit": 1, "write": 1, - "role": "Production Manager", + "role": "Manufacturing Manager", "cancel": 1, "permlevel": 0 }, { "doctype": "DocPerm", - "role": "Production Manager", + "role": "Manufacturing Manager", "permlevel": 1 }, { @@ -335,13 +335,13 @@ "doctype": "DocPerm", "submit": 1, "write": 1, - "role": "Production User", + "role": "Manufacturing User", "cancel": 1, "permlevel": 0 }, { "doctype": "DocPerm", - "role": "Production User", + "role": "Manufacturing User", "permlevel": 1 } ] \ No newline at end of file diff --git a/production/doctype/bom_control/bom_control.txt b/production/doctype/bom_control/bom_control.txt index 3c322e1ca9..baab5f6ada 100644 --- a/production/doctype/bom_control/bom_control.txt +++ b/production/doctype/bom_control/bom_control.txt @@ -5,7 +5,7 @@ { 'creation': '2012-03-27 14:36:02', 'docstatus': 0, - 'modified': '2012-03-27 14:36:02', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -15,7 +15,7 @@ 'colour': u'White:FFF', 'doctype': 'DocType', 'issingle': 1, - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', diff --git a/production/doctype/bom_explosion_item/bom_explosion_item.txt b/production/doctype/bom_explosion_item/bom_explosion_item.txt index 1ba688f77e..a13298d303 100644 --- a/production/doctype/bom_explosion_item/bom_explosion_item.txt +++ b/production/doctype/bom_explosion_item/bom_explosion_item.txt @@ -5,7 +5,7 @@ { 'creation': '2012-03-27 14:36:03', 'docstatus': 0, - 'modified': '2012-03-27 14:36:03', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'jai@webnotestech.com' }, @@ -17,7 +17,7 @@ 'default_print_format': u'Standard', 'doctype': 'DocType', 'istable': 1, - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'read_only': 0, 'section_style': u'Simple', diff --git a/production/doctype/bom_item/bom_item.txt b/production/doctype/bom_item/bom_item.txt index 741de0e030..96d3127db9 100644 --- a/production/doctype/bom_item/bom_item.txt +++ b/production/doctype/bom_item/bom_item.txt @@ -5,7 +5,7 @@ { 'creation': '2012-03-27 14:36:02', 'docstatus': 0, - 'modified': '2012-03-27 14:36:02', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -16,7 +16,7 @@ 'default_print_format': u'Standard', 'doctype': 'DocType', 'istable': 1, - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', diff --git a/production/doctype/bom_operation/bom_operation.txt b/production/doctype/bom_operation/bom_operation.txt index 1e5b93a1ff..9db8fd690f 100644 --- a/production/doctype/bom_operation/bom_operation.txt +++ b/production/doctype/bom_operation/bom_operation.txt @@ -5,7 +5,7 @@ { 'creation': '2012-03-27 14:36:02', 'docstatus': 0, - 'modified': '2012-03-27 14:36:02', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -16,7 +16,7 @@ 'default_print_format': u'Standard', 'doctype': 'DocType', 'istable': 1, - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', diff --git a/production/doctype/production_control/production_control.txt b/production/doctype/production_control/production_control.txt index 4f8564c8e3..9894308a37 100644 --- a/production/doctype/production_control/production_control.txt +++ b/production/doctype/production_control/production_control.txt @@ -15,7 +15,7 @@ 'colour': u'White:FFF', 'doctype': 'DocType', 'issingle': 1, - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', diff --git a/production/doctype/production_order/production_order.txt b/production/doctype/production_order/production_order.txt index 5fed2ddb8c..0877815424 100644 --- a/production/doctype/production_order/production_order.txt +++ b/production/doctype/production_order/production_order.txt @@ -4,14 +4,14 @@ "docstatus": 0, "creation": "2012-07-03 13:30:03", "modified_by": "Administrator", - "modified": "2012-12-03 15:38:54" + "modified": "2012-12-10 18:30:00" }, { "is_submittable": 1, "in_create": 0, "default_print_format": "Standard", "doctype": "DocType", - "module": "Production", + "module": "Manufacturing", "name": "__common__" }, { @@ -307,7 +307,7 @@ "doctype": "DocPerm", "submit": 1, "write": 1, - "role": "Production Manager", + "role": "Manufacturing Manager", "cancel": 1, "permlevel": 0 }, @@ -317,7 +317,7 @@ "doctype": "DocPerm", "submit": 1, "write": 1, - "role": "Production User", + "role": "Manufacturing User", "cancel": 1, "permlevel": 0 } diff --git a/production/doctype/production_plan_item/production_plan_item.txt b/production/doctype/production_plan_item/production_plan_item.txt index cd4507fc1a..6e9b0e2acc 100644 --- a/production/doctype/production_plan_item/production_plan_item.txt +++ b/production/doctype/production_plan_item/production_plan_item.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-07-03 13:30:04", "modified_by": "Administrator", - "modified": "2012-11-29 19:02:38" + "modified": "2012-12-10 18:30:00" }, { "istable": 1, @@ -12,7 +12,7 @@ "name": "__common__", "default_print_format": "Standard", "doctype": "DocType", - "module": "Production" + "module": "Manufacturing" }, { "name": "__common__", diff --git a/production/doctype/production_plan_sales_order/production_plan_sales_order.txt b/production/doctype/production_plan_sales_order/production_plan_sales_order.txt index e42d8d5c46..364803dcb6 100644 --- a/production/doctype/production_plan_sales_order/production_plan_sales_order.txt +++ b/production/doctype/production_plan_sales_order/production_plan_sales_order.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-07-03 13:30:04", "modified_by": "Administrator", - "modified": "2012-11-29 17:49:15" + "modified": "2012-12-10 18:30:00" }, { "istable": 1, @@ -12,7 +12,7 @@ "name": "__common__", "default_print_format": "Standard", "doctype": "DocType", - "module": "Production" + "module": "Manufacturing" }, { "name": "__common__", diff --git a/production/doctype/production_planning_tool/production_planning_tool.txt b/production/doctype/production_planning_tool/production_planning_tool.txt index bf736417d0..bc2a914620 100644 --- a/production/doctype/production_planning_tool/production_planning_tool.txt +++ b/production/doctype/production_planning_tool/production_planning_tool.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-07-03 13:30:03", "modified_by": "Administrator", - "modified": "2012-12-03 15:39:44" + "modified": "2012-12-10 18:30:00" }, { "read_only": 1, @@ -12,7 +12,7 @@ "in_create": 1, "default_print_format": "Standard", "doctype": "DocType", - "module": "Production", + "module": "Manufacturing", "name": "__common__" }, { @@ -209,11 +209,11 @@ "doctype": "DocPerm" }, { - "role": "Production User", + "role": "Manufacturing User", "doctype": "DocPerm" }, { - "role": "Production Manager", + "role": "Manufacturing Manager", "doctype": "DocPerm" } ] \ No newline at end of file diff --git a/production/doctype/workstation/workstation.txt b/production/doctype/workstation/workstation.txt index 999ce58dbe..19af36ebf7 100644 --- a/production/doctype/workstation/workstation.txt +++ b/production/doctype/workstation/workstation.txt @@ -5,7 +5,7 @@ { 'creation': '2012-03-27 14:36:05', 'docstatus': 0, - 'modified': '2012-03-27 18:46:49', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -20,7 +20,7 @@ 'default_print_format': u'Standard', 'doctype': 'DocType', 'document_type': u'Master', - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', @@ -76,7 +76,7 @@ 'create': 1, 'doctype': u'DocPerm', 'permlevel': 0, - 'role': u'Production User', + 'role': u'Manufacturing User', 'write': 1 }, @@ -86,7 +86,7 @@ 'create': 1, 'doctype': u'DocPerm', 'permlevel': 0, - 'role': u'Production User', + 'role': u'Manufacturing User', 'write': 1 }, @@ -94,14 +94,14 @@ { 'doctype': u'DocPerm', 'permlevel': 1, - 'role': u'Production Manager' + 'role': u'Manufacturing Manager' }, # DocPerm { 'doctype': u'DocPerm', 'permlevel': 1, - 'role': u'Production User' + 'role': u'Manufacturing User' }, # DocField diff --git a/production/page/production_home/production_home.js b/production/page/production_home/production_home.js index a4bb398eea..b8066a0bdd 100644 --- a/production/page/production_home/production_home.js +++ b/production/page/production_home/production_home.js @@ -15,6 +15,6 @@ // along with this program. If not, see . pscript['onload_production-home'] = function(wrapper) { - wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'), 'Production'); - erpnext.module_page.setup_page('Production', wrapper); + wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'), 'Manufacturing'); + erpnext.module_page.setup_page('Manufacturing', wrapper); } \ No newline at end of file diff --git a/production/page/production_home/production_home.txt b/production/page/production_home/production_home.txt index 4f6cabb006..33cf0344b6 100644 --- a/production/page/production_home/production_home.txt +++ b/production/page/production_home/production_home.txt @@ -5,7 +5,7 @@ { 'creation': '2012-02-21 13:24:34', 'docstatus': 0, - 'modified': '2012-02-21 13:24:34', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -13,16 +13,16 @@ # These values are common for all Page { 'doctype': 'Page', - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', - 'page_name': u'production-home', + 'page_name': u'manufacturing-home', 'standard': u'Yes', - 'title': u'Production Home' + 'title': u'Manufacturing Home' }, # Page, production-home { 'doctype': 'Page', - 'name': u'production-home' + 'name': u'manufacturing-home' } ] \ No newline at end of file diff --git a/production/search_criteria/consumption_against_production/consumption_against_production.txt b/production/search_criteria/consumption_against_production/consumption_against_production.txt index 54d6a19322..d1aa5172a9 100644 --- a/production/search_criteria/consumption_against_production/consumption_against_production.txt +++ b/production/search_criteria/consumption_against_production/consumption_against_production.txt @@ -5,7 +5,7 @@ { 'creation': '2012-04-03 12:49:50', 'docstatus': 0, - 'modified': '2012-04-03 12:49:50', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'jai@webnotestech.com' }, @@ -20,7 +20,7 @@ 'doc_type': u'Stock Entry Detail', 'doctype': 'Search Criteria', 'filters': u"{'Stock Entry\x01Submitted':1,'Stock Entry\x01Purpose':'Production Order','Stock Entry\x01Process':''}", - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'page_len': 50, 'parent_doc_type': u'Stock Entry', diff --git a/production/search_criteria/itemwise_production_report/itemwise_production_report.txt b/production/search_criteria/itemwise_production_report/itemwise_production_report.txt index 6f0c3eb781..46828c77f0 100644 --- a/production/search_criteria/itemwise_production_report/itemwise_production_report.txt +++ b/production/search_criteria/itemwise_production_report/itemwise_production_report.txt @@ -5,7 +5,7 @@ { 'creation': '2012-04-03 12:49:51', 'docstatus': 0, - 'modified': '2012-04-03 12:49:51', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'jai@webnotestech.com' }, @@ -17,7 +17,7 @@ 'doc_type': u'Stock Entry Detail', 'doctype': 'Search Criteria', 'filters': u"{'Stock Entry\x01Saved':1,'Stock Entry\x01Submitted':1,'Stock Entry\x01Purpose':'Production Order','Stock Entry\x01Process':'Backflush','Stock Entry Detail\x01FG Item':1}", - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'page_len': 50, 'parent_doc_type': u'Stock Entry', diff --git a/production/search_criteria/production_orders_in_process/production_orders_in_process.txt b/production/search_criteria/production_orders_in_process/production_orders_in_process.txt index 51eb1f47e6..d61fff11a2 100644 --- a/production/search_criteria/production_orders_in_process/production_orders_in_process.txt +++ b/production/search_criteria/production_orders_in_process/production_orders_in_process.txt @@ -5,7 +5,7 @@ { 'creation': '2012-04-03 12:49:52', 'docstatus': 0, - 'modified': '2012-04-03 12:49:52', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'jai@webnotestech.com' }, @@ -18,7 +18,7 @@ 'doc_type': u'Production Order', 'doctype': 'Search Criteria', 'filters': u"{'Production Order\x01Submitted':1,'Production Order\x01Origin':'','Production Order\x01Status':'','Production Order\x01Consider SA Items':'','Production Order\x01Fiscal Year':''}", - 'module': u'Production', + 'module': u'Manufacturing', 'name': '__common__', 'page_len': 50, 'sort_by': u'`tabProduction Order`.`name`', diff --git a/public/js/modules.js b/public/js/modules.js index 9fa7f30cb1..bb7488482d 100644 --- a/public/js/modules.js +++ b/public/js/modules.js @@ -21,7 +21,7 @@ erpnext.modules = { 'Buying': 'buying-home', 'Support': 'support-home', 'Projects': 'projects-home', - 'Production': 'production-home', + 'Manufacturing': 'manufacturing-home', 'Website': 'website-home', 'HR': 'hr-home', 'Setup': 'Setup', @@ -65,7 +65,7 @@ wn.module_css_map = { 'Support': 'purple', 'HR': 'ocean', 'Projects': 'violet', - 'Production': 'dark-red', + 'Manufacturing': 'dark-red', 'Website': 'leaf-green', 'Activity': 'brown', 'Setup': 'grey', diff --git a/setup/doctype/features_setup/features_setup.txt b/setup/doctype/features_setup/features_setup.txt index 486e9d356d..4689af63cf 100644 --- a/setup/doctype/features_setup/features_setup.txt +++ b/setup/doctype/features_setup/features_setup.txt @@ -5,7 +5,7 @@ { 'creation': '2012-04-13 11:56:31', 'docstatus': 0, - 'modified': '2012-06-07 18:41:50', + 'modified': '2012-12-10 18:30:00', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -274,7 +274,7 @@ 'doctype': u'DocField', 'fieldname': u'production', 'fieldtype': u'Section Break', - 'label': u'Production' + 'label': u'Manufacturing' }, # DocField diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py index 3d7e11c1f5..fb0b694454 100644 --- a/setup/doctype/setup_control/setup_control.py +++ b/setup/doctype/setup_control/setup_control.py @@ -237,7 +237,7 @@ class DocType: self.add_roles(pr) def add_roles(self, pr): - roles_list = ['Accounts Manager', 'Accounts User', 'Blogger', 'HR Manager', 'HR User', 'Maintenance User', 'Maintenance Manager', 'Material Manager', 'Material User', 'Material Master Manager', 'Production Manager', 'Production User', 'Projects User', 'Purchase Manager', 'Purchase User', 'Purchase Master Manager', 'Quality Manager', 'Sales Manager', 'Sales User', 'Sales Master Manager', 'Support Manager', 'Support Team', 'System Manager', 'Website Manager'] + roles_list = ['Accounts Manager', 'Accounts User', 'Blogger', 'HR Manager', 'HR User', 'Maintenance User', 'Maintenance Manager', 'Material Manager', 'Material User', 'Material Master Manager', 'Manufacturing Manager', 'Manufacturing User', 'Projects User', 'Purchase Manager', 'Purchase User', 'Purchase Master Manager', 'Quality Manager', 'Sales Manager', 'Sales User', 'Sales Master Manager', 'Support Manager', 'Support Team', 'System Manager', 'Website Manager'] for r in roles_list: d = addchild(pr, 'userroles', 'UserRole', 1) d.role = r diff --git a/setup/page/modules_setup/modules_setup.js b/setup/page/modules_setup/modules_setup.js index 71fed933b2..eac0e8c530 100644 --- a/setup/page/modules_setup/modules_setup.js +++ b/setup/page/modules_setup/modules_setup.js @@ -1,7 +1,7 @@ wn.require('lib/js/lib/jquery/jquery.ui.sortable.js'); $.extend(wn.pages.modules_setup, { - modules: ['Activity', 'Accounts', 'Selling', 'Buying', 'Stock', 'Production', 'Projects', + modules: ['Activity', 'Accounts', 'Selling', 'Buying', 'Stock', 'Manufacturing', 'Projects', 'Support', 'HR', 'Website', 'To Do', 'Messages', 'Calendar', 'Knowledge Base'], onload: function(wrapper) { wn.pages.modules_setup.refresh_page(wn.boot.modules_list); diff --git a/stock/doctype/stock_entry/stock_entry.txt b/stock/doctype/stock_entry/stock_entry.txt index 5d2a79d5b7..247395739a 100644 --- a/stock/doctype/stock_entry/stock_entry.txt +++ b/stock/doctype/stock_entry/stock_entry.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-11-28 11:26:22", "modified_by": "Administrator", - "modified": "2012-12-03 12:00:59" + "modified": "2012-12-10 18:30:00" }, { "is_submittable": 1, @@ -794,13 +794,13 @@ "create": 0, "doctype": "DocPerm", "write": 1, - "role": "Production User", + "role": "Manufacturing User", "permlevel": 2 }, { "doctype": "DocPerm", "write": 1, - "role": "Production Manager", + "role": "Manufacturing Manager", "permlevel": 2 }, { @@ -809,13 +809,13 @@ "doctype": "DocPerm", "submit": 1, "write": 1, - "role": "Production User", + "role": "Manufacturing User", "cancel": 1, "permlevel": 0 }, { "doctype": "DocPerm", - "role": "Production User", + "role": "Manufacturing User", "permlevel": 1 }, { @@ -824,13 +824,13 @@ "doctype": "DocPerm", "submit": 1, "write": 1, - "role": "Production Manager", + "role": "Manufacturing Manager", "cancel": 1, "permlevel": 0 }, { "doctype": "DocPerm", - "role": "Production Manager", + "role": "Manufacturing Manager", "permlevel": 1 }, {