Rushabh Mehta | 3966f1d | 2012-02-23 12:35:32 +0530 | [diff] [blame] | 1 | # ERPNext - web based ERP (http://erpnext.com) |
| 2 | # Copyright (C) 2012 Web Notes Technologies Pvt Ltd |
| 3 | # |
| 4 | # This program is free software: you can redistribute it and/or modify |
| 5 | # it under the terms of the GNU General Public License as published by |
| 6 | # the Free Software Foundation, either version 3 of the License, or |
| 7 | # (at your option) any later version. |
| 8 | # |
| 9 | # This program is distributed in the hope that it will be useful, |
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | # GNU General Public License for more details. |
| 13 | # |
| 14 | # You should have received a copy of the GNU General Public License |
| 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 17 | # REMEMBER to update this |
| 18 | # ======================== |
nabinhait | a56fc00 | 2011-07-01 16:32:03 +0530 | [diff] [blame] | 19 | |
Nabin Hait | c0d7434 | 2011-10-14 00:14:31 +0530 | [diff] [blame] | 20 | last_patch = 388 |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 21 | |
| 22 | #------------------------------------------- |
| 23 | |
Nabin Hait | c57c5b0 | 2011-12-16 10:17:26 +0530 | [diff] [blame] | 24 | def execute(patch_no): |
| 25 | return |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 26 | import webnotes |
Rushabh Mehta | ae4d1f9 | 2012-03-12 14:34:55 +0530 | [diff] [blame] | 27 | from webnotes.modules import reload_doc |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 28 | |
| 29 | from webnotes.model.code import get_obj |
| 30 | sql = webnotes.conn.sql |
| 31 | from webnotes.utils import cint, cstr, flt |
| 32 | from webnotes.model.doc import Document |
Rushabh Mehta | 33bce67 | 2011-08-25 15:15:25 +0530 | [diff] [blame] | 33 | from webnotes.model import delete_doc |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 34 | |
Rushabh Mehta | 9e6e7fa | 2011-08-25 16:08:06 +0530 | [diff] [blame] | 35 | if patch_no == 301: |
nabinhait | 690c697 | 2011-06-28 14:42:07 +0530 | [diff] [blame] | 36 | from patches.delivery_billing_status_patch import run_patch |
| 37 | run_patch() |
nabinhait | b393000 | 2011-06-28 16:50:38 +0530 | [diff] [blame] | 38 | elif patch_no == 302: |
| 39 | sql("update `tabDocField` set no_copy = 1 where fieldname = 'naming_series'") |
Ravi Dey | 4c65119 | 2011-06-28 19:36:18 +0530 | [diff] [blame] | 40 | elif patch_no == 303: |
Ravi Dey | 27c5b40 | 2011-06-29 18:05:18 +0530 | [diff] [blame] | 41 | pass |
| 42 | elif patch_no == 304: |
Rushabh Mehta | c71eeb6 | 2011-06-30 08:28:36 +0530 | [diff] [blame] | 43 | sql("delete from `tabDocField` where parent = 'company' and label = 'Trash Company' and fieldtype = 'button'") |
Ravi Dey | c674e43 | 2011-06-29 18:15:12 +0530 | [diff] [blame] | 44 | reload_doc('setup', 'doctype', 'company') |
Ravi Dey | 79c2865 | 2011-06-29 18:55:19 +0530 | [diff] [blame] | 45 | elif patch_no == 305: |
| 46 | sql("update `tabDocField` set options = 'link:Company' where options='link:Company' and fieldname='company' and fieldtype='Select'") |
nabinhait | ec09797 | 2011-07-01 13:34:41 +0530 | [diff] [blame] | 47 | elif patch_no == 306: |
Ravi Dey | 94a332a | 2011-07-01 13:50:34 +0530 | [diff] [blame] | 48 | sql("update `tabDocField` set options = '\nAccount\nCompany\nCustomer\nSupplier\nEmployee\nWarehouse\nItem' where parent = 'Rename Tool' and fieldname = 'select_doctype'") |
| 49 | sql("update `tabDocField` set options = 'link:Item' where parent = 'Raw Materials Supplied' and fieldname = 'po_item'") |
| 50 | sql("update `tabDocField` set options = 'Sales Order' where parent = 'Indent Detail' and fieldname = 'sales_order_no'") |
| 51 | sql("update `tabDocField` set options = 'link:Company', fieldtype = 'Select' where parent = 'Stock Ledger Entry' and fieldname = 'company'") |
Nabin Hait | 31a407d | 2011-07-28 11:47:45 +0530 | [diff] [blame] | 52 | reload_doc('utilities', 'doctype', 'rename_tool') |
Ravi Dey | 627d01b | 2011-07-01 14:05:43 +0530 | [diff] [blame] | 53 | elif patch_no == 307: |
| 54 | sql("delete from `tabDocField` where parent = 'company' and label = 'Trash Company' and fieldtype = 'Button'") |
| 55 | reload_doc('setup', 'doctype', 'company') |
nabinhait | a56fc00 | 2011-07-01 16:32:03 +0530 | [diff] [blame] | 56 | elif patch_no == 308: |
Ravi Dey | c1886b5 | 2011-07-04 16:53:42 +0530 | [diff] [blame] | 57 | sql("update `tabDocField` set reqd = 0 where fieldname = 'select_item' and parent = 'Property Setter'") |
nabinhait | 1bd56b1 | 2011-07-05 14:41:36 +0530 | [diff] [blame] | 58 | elif patch_no == 309: |
| 59 | sql("delete from `tabDocField` where fieldname = 'item_attachments_details' and parent = 'Item'") |
nabinhait | 7f339e0 | 2011-07-05 15:43:17 +0530 | [diff] [blame] | 60 | sql("delete from `tabModule Def Item` where parent = 'Stock' and doc_name = 'Landed Cost Wizard'") |
nabinhait | 5deab24 | 2011-07-06 09:23:02 +0530 | [diff] [blame] | 61 | elif patch_no == 310: |
| 62 | from erpnext_structure_cleanup import run_patches |
| 63 | run_patches() |
nabinhait | 4bb8bf4 | 2011-07-06 10:11:11 +0530 | [diff] [blame] | 64 | elif patch_no == 311: |
| 65 | sql("update `tabDocField` set reqd = 0 where fieldname = 'select_item' and parent = 'Property Setter'") |
nabinhait | 4c38fbb | 2011-07-06 10:36:53 +0530 | [diff] [blame] | 66 | #reload_doc('core', 'doctype', 'property_setter') |
nabinhait | 4bb8bf4 | 2011-07-06 10:11:11 +0530 | [diff] [blame] | 67 | elif patch_no == 312: |
| 68 | sql("delete from `tabSessions`") |
| 69 | sql("delete from `__SessionCache`") |
nabinhait | d54ec52 | 2011-07-06 12:20:21 +0530 | [diff] [blame] | 70 | elif patch_no == 313: |
| 71 | dt = ['GL Entry', 'Stock Ledger Entry'] |
| 72 | for t in dt: |
| 73 | rec = sql("select voucher_type, voucher_no, ifnull(is_cancelled, 'No') from `tab%s` where modified >= '2011-07-06 10:00:00' group by voucher_no" % t) |
| 74 | for d in rec: |
nabinhait | fccbb09 | 2011-07-06 12:23:27 +0530 | [diff] [blame] | 75 | sql("update `tab%s` set docstatus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2, d[1])) |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 76 | |
nabinhait | d54ec52 | 2011-07-06 12:20:21 +0530 | [diff] [blame] | 77 | other_dt = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note'] |
| 78 | for dt in other_dt: |
| 79 | rec = sql("select name, status from `tab%s` where modified >= '2011-07-06 10:00:00'" % dt) |
| 80 | for r in rec: |
| 81 | sql("update `tab%s` set docstatus = %s where name = '%s'" % (dt, (r[1] in ['Submitted', 'Closed'] and 1 or r[1]=='Cancelled' and 2 or 0), r[0])) |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 82 | |
| 83 | |
nabinhait | d54ec52 | 2011-07-06 12:20:21 +0530 | [diff] [blame] | 84 | dt_list = ['Delivery Note', 'Purchase Receipt'] |
| 85 | for dt in dt_list: |
| 86 | sql("update `tab%s` set status = 'Submitted' where docstatus = 1 and modified >='2011-07-06 10:00:00'" % dt) |
| 87 | sql("update `tab%s` set status = 'Cancelled' where docstatus = 2 and modified >='2011-07-06 10:00:00'" % dt) |
| 88 | |
| 89 | dt_list = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note', 'Receivable Voucher', 'Payable Voucher', 'Delivery Note', 'Purchase Receipt', 'Journal Voucher', 'Stock Entry'] |
| 90 | for d in dt_list: |
| 91 | tbl = sql("select options from `tabDocField` where fieldtype = 'Table' and parent = '%s'" % d) |
| 92 | for t in tbl: |
| 93 | sql("update `tab%s` t1, `tab%s` t2 set t1.docstatus = t2.docstatus where t1.parent = t2.name" % (t[0], d)) |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 94 | |
nabinhait | 22f7edd | 2011-07-06 12:45:02 +0530 | [diff] [blame] | 95 | elif patch_no == 314: |
| 96 | # delete double feed |
| 97 | sql("delete from tabFeed where subject like 'New %'") |
nabinhait | eb31540 | 2011-07-06 13:03:31 +0530 | [diff] [blame] | 98 | elif patch_no == 315: |
| 99 | # delete double feed |
| 100 | sql("delete from tabFeed where doc_name like 'New %'") |
| 101 | reload_doc('core', 'doctype', 'property_setter') |
| 102 | |
| 103 | from webnotes.model.doc import Document |
| 104 | m = Document('Module Def Role') |
| 105 | m.role = 'All' |
| 106 | m.parent = 'Home' |
| 107 | m.parenttype = 'Module Def' |
| 108 | m.parentfield = 'roles' |
| 109 | m.save(1) |
Ravi Dey | 7a6211d | 2011-07-07 15:49:24 +0530 | [diff] [blame] | 110 | elif patch_no == 316: |
Ravi Dey | 8982272 | 2011-07-07 15:52:35 +0530 | [diff] [blame] | 111 | pass |
| 112 | elif patch_no == 317: |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 113 | sql("update `tabPage` set name = 'profile-settings' where page_name = 'Profile Settings'") |
Anand Doshi | 56ab7e4 | 2011-07-07 18:37:58 +0530 | [diff] [blame] | 114 | elif patch_no == 318: |
Ravi Dey | cfc5dff | 2011-07-07 16:48:54 +0530 | [diff] [blame] | 115 | reload_doc('utilities', 'doctype', 'bulk_rename_tool') |
Anand Doshi | 52b1d5a | 2011-07-07 18:41:12 +0530 | [diff] [blame] | 116 | elif patch_no == 319: |
Anand Doshi | 56ab7e4 | 2011-07-07 18:37:58 +0530 | [diff] [blame] | 117 | sql("delete from tabFeed where doc_name like 'New %'") |
nabinhait | 63cf2b9 | 2011-07-08 13:30:46 +0530 | [diff] [blame] | 118 | elif patch_no == 320: |
| 119 | reload_doc('setup', 'doctype', 'series_detail') |
Ravi Dey | fac96e1 | 2011-07-08 13:38:16 +0530 | [diff] [blame] | 120 | elif patch_no == 321: |
Ravi Dey | 8491384 | 2011-07-08 13:46:09 +0530 | [diff] [blame] | 121 | reload_doc('hr','doctype','leave_application') |
| 122 | elif patch_no == 322: |
| 123 | sql("delete from `tabDocField` where parent = 'Leave Application' and fieldname = 'latter_head'") |
Nabin Hait | 2acac4b | 2011-07-10 13:52:05 +0530 | [diff] [blame] | 124 | elif patch_no == 323: |
| 125 | reload_doc('stock', 'doctype', 'stock_entry') |
Nabin Hait | e079a6e | 2011-07-10 14:15:52 +0530 | [diff] [blame] | 126 | sql("update `tabDocField` set options = 'get_stock_and_rate' where parent = 'Stock Entry' and label = 'Get Stock and Rate'") |
| 127 | sql("delete from `tabDocField` where label = 'Get Current Stock' and parent = 'Stock Entry'") |
nabinhait | 54b0e7d | 2011-07-13 16:40:03 +0530 | [diff] [blame] | 128 | elif patch_no == 324: |
| 129 | sql("delete from `tabDocField` where fieldname = 'test_field' and parent = 'Customer'") |
Ravi Dey | 9dd0c0b | 2011-07-13 18:08:38 +0530 | [diff] [blame] | 130 | elif patch_no == 325: |
| 131 | sql("update `tabDocField` set fieldtype = 'Data' where parent = 'Salary Slip' and fieldname = 'total_days_in_month'") |
| 132 | reload_doc('hr', 'doctype', 'salary_slip') |
Rushabh Mehta | 6179080 | 2011-07-17 10:52:47 +0530 | [diff] [blame] | 133 | elif patch_no == 326: |
| 134 | # load the new billing page |
| 135 | if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')): |
| 136 | reload_doc('server_tools','page','billing') |
nabinhait | e652636 | 2011-07-19 18:09:26 +0530 | [diff] [blame] | 137 | elif patch_no == 327: |
Rushabh Mehta | 391aa02 | 2011-07-25 14:07:50 +0530 | [diff] [blame] | 138 | # patch for support email settings now moved to email settings |
| 139 | reload_doc('setup','doctype','email_settings') |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 140 | |
Rushabh Mehta | 391aa02 | 2011-07-25 14:07:50 +0530 | [diff] [blame] | 141 | # map fields from support to email settings |
| 142 | field_map = { |
| 143 | 'support_email': 'email', |
| 144 | 'support_host':'host', |
| 145 | 'support_username': 'username', |
| 146 | 'support_password': 'password', |
Rushabh Mehta | b7186d4 | 2011-07-25 14:37:48 +0530 | [diff] [blame] | 147 | 'support_use_ssl': 'use_ssl', |
Rushabh Mehta | 391aa02 | 2011-07-25 14:07:50 +0530 | [diff] [blame] | 148 | 'sync_support_mails': 'integrate_incoming', |
| 149 | 'signature': 'support_signature' |
| 150 | } |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 151 | |
Rushabh Mehta | 391aa02 | 2011-07-25 14:07:50 +0530 | [diff] [blame] | 152 | for key in field_map: |
| 153 | webnotes.conn.set_value('Email Settings',None,key, \ |
| 154 | webnotes.conn.get_value('Support Email Settings',None,field_map[key])) |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 155 | |
Rushabh Mehta | 391aa02 | 2011-07-25 14:07:50 +0530 | [diff] [blame] | 156 | # delete support email settings |
Rushabh Mehta | 391aa02 | 2011-07-25 14:07:50 +0530 | [diff] [blame] | 157 | delete_doc('DocType', 'Support Email Settings') |
| 158 | |
Rushabh Mehta | 9b8fad2 | 2011-07-25 14:45:42 +0530 | [diff] [blame] | 159 | reload_doc('support','doctype','support_ticket') |
Nabin Hait | 587ac5c | 2011-07-26 15:46:10 +0530 | [diff] [blame] | 160 | sql("delete from tabDocField where fieldname='problem_description' and parent='Support Ticket'") |
| 161 | elif patch_no == 328: |
nabinhait | e652636 | 2011-07-19 18:09:26 +0530 | [diff] [blame] | 162 | if webnotes.conn.get_value('Control Panel', None, 'account_id') != 'axjanak2011': |
| 163 | sql("delete from `tabDocField` where fieldname = 'supplier_status' and parent = 'Supplier'") |
Nabin Hait | 587ac5c | 2011-07-26 15:46:10 +0530 | [diff] [blame] | 164 | elif patch_no == 329: |
nabinhait | de9826c | 2011-07-20 18:02:59 +0530 | [diff] [blame] | 165 | reload_doc('utilities', 'doctype', 'rename_tool') |
| 166 | reload_doc('utilities', 'doctype', 'bulk_rename_tool') |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 167 | elif patch_no == 330: |
| 168 | reload_doc('accounts', 'doctype', 'lease_agreement') |
| 169 | reload_doc('accounts', 'doctype', 'lease_installment') |
| 170 | |
| 171 | reload_doc('accounts', 'search_criteria', 'lease_agreement_list') |
| 172 | reload_doc('accounts', 'search_criteria', 'lease_monthly_future_installment_inflows') |
| 173 | reload_doc('accounts', 'search_criteria', 'lease_overdue_age_wise') |
Nabin Hait | f541b74 | 2011-07-28 15:33:42 +0530 | [diff] [blame] | 174 | reload_doc('accounts', 'search_criteria', 'lease_over_due_list') |
Brahma K | 0930762 | 2011-07-27 12:03:34 +0530 | [diff] [blame] | 175 | reload_doc('accounts', 'search_criteria', 'lease_receipts_client_wise') |
| 176 | reload_doc('accounts', 'search_criteria', 'lease_receipt_summary_year_to_date') |
| 177 | reload_doc('accounts', 'search_criteria', 'lease_yearly_future_installment_inflows') |
Brahma K | bcdade5 | 2011-07-27 12:11:09 +0530 | [diff] [blame] | 178 | |
| 179 | reload_doc('accounts', 'Module Def', 'Accounts') |
Brahma K | 3b1ebe0 | 2011-07-27 13:04:11 +0530 | [diff] [blame] | 180 | elif patch_no == 331: |
| 181 | p = get_obj('Patch Util') |
| 182 | # permission |
| 183 | p.add_permission('Lease Agreement', 'Accounts Manager', 0, read = 1, write=1,submit=1, cancel=1,amend=1) |
| 184 | p.add_permission('Lease Agreement', 'Accounts Manager', 1, read = 1) |
Nabin Hait | d29916b | 2011-07-27 14:26:23 +0530 | [diff] [blame] | 185 | elif patch_no == 332: |
| 186 | sql("update `tabDocField` set permlevel=1, hidden = 1 where parent = 'Bulk Rename Tool' and fieldname = 'file_list'") |
Brahma K | e8ec975 | 2011-08-16 12:21:07 +0530 | [diff] [blame] | 187 | elif patch_no == 333: |
Nabin Hait | d31de59 | 2011-08-10 14:01:27 +0530 | [diff] [blame] | 188 | sql("update `tabDocPerm` set `create` =1 where role = 'Accounts Manager' and parent = 'Lease Agreement'") |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 189 | |
Nabin Hait | 812e718 | 2011-08-05 11:10:30 +0530 | [diff] [blame] | 190 | p = get_obj('Patch Util') |
| 191 | p.add_permission('DocType Mapper', 'System Manager', 0, read = 1, write=1, create=1) |
| 192 | p.add_permission('Role', 'System Manager', 0, read = 1, write=1, create=1) |
| 193 | p.add_permission('Print Format', 'System Manager', 0, read = 1, write=1, create=1) |
Nabin Hait | c4e579c | 2011-08-05 11:21:35 +0530 | [diff] [blame] | 194 | elif patch_no == 334: |
| 195 | reload_doc('knowledge_base', 'doctype', 'answer') |
Nabin Hait | f82b1cc | 2011-08-05 13:23:14 +0530 | [diff] [blame] | 196 | elif patch_no == 335: |
Nabin Hait | 2c0ab73 | 2011-08-05 13:40:04 +0530 | [diff] [blame] | 197 | for dt in ['Account', 'Cost Center', 'Territory', 'Item Group', 'Customer Group']: |
Anand Doshi | b61abff | 2011-08-10 11:58:05 +0530 | [diff] [blame] | 198 | sql("update `tabDocField` set fieldtype = 'Link', options = %s where fieldname = 'old_parent' and parent = %s", (dt, dt)) |
| 199 | elif patch_no == 336: |
Anand Doshi | aabf174 | 2011-08-10 13:27:25 +0530 | [diff] [blame] | 200 | reload_doc('server_tools','page','billing') |
| 201 | elif patch_no == 337: |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 202 | item_list = webnotes.conn.sql("""SELECT name, description_html |
Anand Doshi | aabf174 | 2011-08-10 13:27:25 +0530 | [diff] [blame] | 203 | FROM tabItem""") |
| 204 | if item_list: |
| 205 | for item, html in item_list: |
| 206 | if html and "getfile" in html and "acx" in html: |
| 207 | ac_id = webnotes.conn.sql("""SELECT value FROM `tabSingles` WHERE doctype='Control Panel' AND field='account_id'""") |
| 208 | sp_acx = html.split("acx=") |
| 209 | l_acx = len(sp_acx) |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 210 | if l_acx > 1: |
Anand Doshi | aabf174 | 2011-08-10 13:27:25 +0530 | [diff] [blame] | 211 | for i in range(l_acx-1): |
| 212 | sp_quot = sp_acx[i+1].split('"') |
| 213 | if len(sp_quot) > 1: sp_quot[0] = str(ac_id[0][0]) |
| 214 | sp_acx[i+1] = '"'.join(sp_quot) |
| 215 | html = "acx=".join(sp_acx) |
Nabin Hait | d31de59 | 2011-08-10 14:01:27 +0530 | [diff] [blame] | 216 | webnotes.conn.sql("""UPDATE tabItem SET description_html=%s WHERE name=%s""", (html, item)) |
Nabin Hait | 76980b0 | 2011-08-10 16:35:25 +0530 | [diff] [blame] | 217 | elif patch_no == 338: |
| 218 | # Patch for billing status based on amount |
| 219 | # reload so and dn |
| 220 | reload_doc('selling','doctype','sales_order') |
| 221 | reload_doc('stock','doctype','delivery_note') |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 222 | |
Nabin Hait | 76980b0 | 2011-08-10 16:35:25 +0530 | [diff] [blame] | 223 | # delete billed_qty field |
| 224 | sql("delete from `tabDocField` where fieldname = 'billed_qty' and parent in ('Sales Order Detail', 'Delivery Note Detail')") |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 225 | |
Nabin Hait | 76980b0 | 2011-08-10 16:35:25 +0530 | [diff] [blame] | 226 | # update billed amt in item table in so and dn |
| 227 | sql(""" update `tabSales Order Detail` so |
| 228 | set billed_amt = (select sum(amount) from `tabRV Detail` where `so_detail`= so.name and docstatus=1 and parent not like 'old%%'), modified = now()""") |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 229 | |
Nabin Hait | 76980b0 | 2011-08-10 16:35:25 +0530 | [diff] [blame] | 230 | sql(""" update `tabDelivery Note Detail` dn |
| 231 | set billed_amt = (select sum(amount) from `tabRV Detail` where `dn_detail`= dn.name and docstatus=1 and parent not like 'old%%'), modified = now()""") |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 232 | |
Nabin Hait | 76980b0 | 2011-08-10 16:35:25 +0530 | [diff] [blame] | 233 | # calculate % billed based on item table |
| 234 | sql(""" update `tabSales Order` so |
| 235 | set per_billed = (select sum(if(amount > ifnull(billed_amt, 0), billed_amt, amount))/sum(amount)*100 from `tabSales Order Detail` where parent = so.name), modified = now()""") |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 236 | |
Nabin Hait | 76980b0 | 2011-08-10 16:35:25 +0530 | [diff] [blame] | 237 | sql(""" update `tabDelivery Note` dn |
| 238 | set per_billed = (select sum(if(amount > ifnull(billed_amt, 0), billed_amt, amount))/sum(amount)*100 from `tabDelivery Note Detail` where parent = dn.name), modified = now()""") |
| 239 | |
| 240 | # update billing status based on % billed |
| 241 | sql("""update `tabSales Order` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', |
| 242 | if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""") |
| 243 | sql("""update `tabDelivery Note` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', |
| 244 | if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""") |
Rushabh Mehta | ab5292a | 2011-08-16 10:04:29 +0530 | [diff] [blame] | 245 | |
Rushabh Mehta | af43b74 | 2011-08-11 12:37:11 +0530 | [diff] [blame] | 246 | # update name of questions page |
| 247 | sql("update tabPage set name='questions' where name='Questions'") |
Brahma K | 2eb8101 | 2011-08-16 12:27:48 +0530 | [diff] [blame] | 248 | sql("update tabPage set name='question-view' where name='Question View'") |
Brahma K | fce442e | 2011-08-16 14:48:46 +0530 | [diff] [blame] | 249 | elif patch_no == 339: |
Brahma K | e8ec975 | 2011-08-16 12:21:07 +0530 | [diff] [blame] | 250 | reload_doc('production','doctype','bill_of_materials') |
Nabin Hait | 9537446 | 2011-08-22 14:40:11 +0530 | [diff] [blame] | 251 | elif patch_no == 340: |
| 252 | sql("update `tabDocField` set permlevel = 0 where (fieldname in ('process', 'production_order', 'fg_completed_qty') or label = 'Get Items') and parent = 'Stock Entry'") |
Brahma K | 82187ce | 2011-08-23 15:42:34 +0530 | [diff] [blame] | 253 | elif patch_no == 341: |
| 254 | reload_doc('stock','doctype','delivery_note') |
Brahma K | 6716480 | 2011-08-23 16:22:29 +0530 | [diff] [blame] | 255 | reload_doc('stock','doctype','item') |
| 256 | reload_doc('selling','doctype','quotation') |
Brahma K | 82187ce | 2011-08-23 15:42:34 +0530 | [diff] [blame] | 257 | reload_doc('stock','Print Format','Delivery Note Packing List Wise') |
| 258 | |
| 259 | if not sql("select format from `tabDocFormat` where name = 'Delivery Note Packing List Wise' and parent = 'Delivery Note'"): |
| 260 | from webnotes.model.doc import addchild |
| 261 | dt_obj = get_obj('DocType', 'Delivery Note', with_children = 1) |
| 262 | ch = addchild(dt_obj.doc, 'formats', 'DocFormat', 1) |
| 263 | ch.format = 'Delivery Note Packing List Wise' |
| 264 | ch.save(1) |
Brahma K | c735d44 | 2011-08-23 18:38:48 +0530 | [diff] [blame] | 265 | elif patch_no == 342: |
Nabin Hait | a0760df | 2011-08-23 17:29:54 +0530 | [diff] [blame] | 266 | sql("update `tabDocField` set permlevel = 0 where parent = 'Stock Entry Detail' and fieldname in ('s_warehouse', 't_warehouse', 'fg_item')") |
Brahma K | b25ed70 | 2011-08-23 18:41:25 +0530 | [diff] [blame] | 267 | elif patch_no == 343: |
Brahma K | c735d44 | 2011-08-23 18:38:48 +0530 | [diff] [blame] | 268 | reload_doc('stock','doctype','item_customer_detail') |
Nabin Hait | cfe8ee8 | 2011-08-25 14:02:01 +0530 | [diff] [blame] | 269 | elif patch_no == 344: |
Nabin Hait | 7b8f53c | 2011-08-24 11:23:34 +0530 | [diff] [blame] | 270 | sql("delete from `tabDocFormat` where ifnull(format, '') = '' and parent = 'Delivery Note'") |
Rushabh Mehta | 8cf4517 | 2011-09-08 14:17:41 +0530 | [diff] [blame] | 271 | reload_doc('stock', 'doctype', 'delivery_note_detail') |
| 272 | reload_doc('stock', 'doctype', 'item_customer_detail') |
Rushabh Mehta | 33bce67 | 2011-08-25 15:15:25 +0530 | [diff] [blame] | 273 | elif patch_no == 345: |
Rushabh Mehta | 910d955 | 2011-08-30 16:09:01 +0530 | [diff] [blame] | 274 | # rerun 343 (merge confict) |
| 275 | reload_doc('stock','doctype','item_customer_detail') |
Nabin Hait | cfe8ee8 | 2011-08-25 14:02:01 +0530 | [diff] [blame] | 276 | sql("delete from `tabModule Def Item` where display_name = 'Salary Slip Control Panel' and parent = 'HR'") |
| 277 | reload_doc('hr','Module Def','HR') |
Rushabh Mehta | 33bce67 | 2011-08-25 15:15:25 +0530 | [diff] [blame] | 278 | elif patch_no == 346: |
Rushabh Mehta | 96fde95 | 2011-08-29 17:54:27 +0530 | [diff] [blame] | 279 | pass |
Nabin Hait | 2c03015 | 2011-08-25 19:41:24 +0530 | [diff] [blame] | 280 | elif patch_no == 347: |
| 281 | sql("delete from `tabField Mapper Detail` where from_field = to_field and map = 'Yes' and ifnull(checking_operator, '') = ''") |
Nabin Hait | 1d5cab8 | 2011-08-29 13:16:52 +0530 | [diff] [blame] | 282 | elif patch_no == 348: |
| 283 | sql("update `tabStock Ledger Entry` set is_cancelled = 'No' where voucher_type = 'Serial No'") |
Nabin Hait | e0410da | 2011-08-29 14:24:19 +0530 | [diff] [blame] | 284 | elif patch_no == 349: |
| 285 | delete_doc('Custom Script', 'Update Series-Server') |
| 286 | delete_doc('Custom Script', 'Profile-Client') |
| 287 | delete_doc('Custom Script', 'Event-Client') |
| 288 | delete_doc('Custom Script', 'File-Server') |
Brahma K | 3c9a6a1 | 2011-08-31 12:55:41 +0530 | [diff] [blame] | 289 | |
Rushabh Mehta | 96fde95 | 2011-08-29 17:54:27 +0530 | [diff] [blame] | 290 | # reload profile with new fields for security |
| 291 | delete_doc('DocType', 'Profile') |
| 292 | reload_doc('core', 'doctype', 'profile') |
Nabin Hait | 7282fce | 2011-08-30 17:34:14 +0530 | [diff] [blame] | 293 | elif patch_no == 350: |
| 294 | reload_doc('stock', 'doctype', 'delivery_note_detail') |
| 295 | reload_doc('stock', 'doctype', 'item_customer_detail') |
Nabin Hait | 9359213 | 2011-08-31 11:27:51 +0530 | [diff] [blame] | 296 | elif patch_no == 351: |
| 297 | reload_doc('home', 'page', 'dashboard') |
Nabin Hait | ef75761 | 2011-09-02 13:10:23 +0530 | [diff] [blame] | 298 | elif patch_no == 352: |
| 299 | reload_doc('stock','doctype','delivery_note') |
| 300 | reload_doc('stock','doctype','item') |
| 301 | reload_doc('selling','doctype','quotation') |
| 302 | reload_doc('stock','Print Format','Delivery Note Packing List Wise') |
| 303 | |
| 304 | if not sql("select format from `tabDocFormat` where name = 'Delivery Note Packing List Wise' and parent = 'Delivery Note'"): |
| 305 | from webnotes.model.doc import addchild |
| 306 | dt_obj = get_obj('DocType', 'Delivery Note', with_children = 1) |
| 307 | ch = addchild(dt_obj.doc, 'formats', 'DocFormat', 1) |
| 308 | ch.format = 'Delivery Note Packing List Wise' |
| 309 | ch.save(1) |
Nabin Hait | c63e62e | 2011-09-02 14:44:15 +0530 | [diff] [blame] | 310 | elif patch_no == 353: |
Rushabh Mehta | 5f50617 | 2011-09-13 15:48:51 +0530 | [diff] [blame] | 311 | reload_doc('core', 'doctype', 'doctype') |
| 312 | sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") |
Nabin Hait | 8c2618c | 2011-09-02 17:43:32 +0530 | [diff] [blame] | 313 | elif patch_no == 354: |
Rushabh Mehta | 5f50617 | 2011-09-13 15:48:51 +0530 | [diff] [blame] | 314 | reload_doc('stock', 'doctype', 'delivery_note') |
| 315 | reload_doc('stock', 'doctype', 'delivery_note_detail') |
| 316 | elif patch_no == 355: |
| 317 | sql("update `tabDocField` set print_hide =1 where fieldname in ('pack_no', 'pack_gross_wt', 'weight_uom', 'pack_nett_wt') and parent = 'Delivery Note Detail'") |
| 318 | elif patch_no == 356: |
| 319 | sql("update `tabDocField` set print_hide =1 where fieldname = 'print_packing_slip' and parent = 'Delivery Note'") |
| 320 | elif patch_no == 357: |
| 321 | reload_doc('hr', 'doctype', 'salary_manager') |
| 322 | elif patch_no == 358: |
Rushabh Mehta | b5717bd | 2011-09-06 12:46:33 +0530 | [diff] [blame] | 323 | reload_doc('setup', 'doctype','features_setup') |
Brahma K | 3c9a6a1 | 2011-08-31 12:55:41 +0530 | [diff] [blame] | 324 | reload_doc('stock','doctype','item') |
| 325 | sql("update tabDocField set label='Produced Qty',description='Updated after finished goods are transferred to FG Warehouse through Stock Entry' where parent='Production Order' and fieldname='produced_qty'") |
Brahma K | 8e8c482 | 2011-08-31 15:46:29 +0530 | [diff] [blame] | 326 | rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null") |
| 327 | from webnotes.model.doc import Document |
Nabin Hait | 0b5f9b0 | 2011-09-16 14:32:23 +0530 | [diff] [blame] | 328 | m = Document('Features Setup') |
Brahma K | 8e8c482 | 2011-08-31 15:46:29 +0530 | [diff] [blame] | 329 | for d in rs: |
| 330 | m.fields[d[0]] = 1 |
Brahma K | 779cfaf | 2011-09-02 16:55:03 +0530 | [diff] [blame] | 331 | m.save() |
Rushabh Mehta | 5f50617 | 2011-09-13 15:48:51 +0530 | [diff] [blame] | 332 | elif patch_no == 359: |
Nabin Hait | 8c2618c | 2011-09-02 17:43:32 +0530 | [diff] [blame] | 333 | reload_doc('hr', 'doctype', 'salary_slip') |
| 334 | delete_doc('DocType', 'Salary Control Panel') |
Rushabh Mehta | 5f50617 | 2011-09-13 15:48:51 +0530 | [diff] [blame] | 335 | elif patch_no == 360: |
Rushabh Mehta | 8cf4517 | 2011-09-08 14:17:41 +0530 | [diff] [blame] | 336 | sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") |
Rushabh Mehta | 5f50617 | 2011-09-13 15:48:51 +0530 | [diff] [blame] | 337 | elif patch_no == 361: |
| 338 | sql("update `tabModule Def Item` set doc_name = 'GL Entry' where display_name in ('Lease Agreement List', 'Lease Monthly Future Installment Inflows', 'Lease Overdue Age Wise', 'Lease Overdue List', 'Lease Receipts Client Wise', 'Lease Receipt Summary Month Wise', 'Lease Yearly Future Installment Inflows') and parent = 'Accounts'") |
| 339 | elif patch_no == 362: |
| 340 | sql("update `tabDocField` set no_copy = 1 where fieldname in ('amended_from', 'amendment_date', 'file_list', 'naming_series', 'status')") |
| 341 | elif patch_no == 363: |
| 342 | reload_doc('accounts', 'search_criteria', 'voucher_wise_tax_details') |
| 343 | reload_doc('accounts', 'Module Def', 'Accounts') |
| 344 | mappers = sql("select name, module from `tabDocType Mapper`") |
| 345 | for d in mappers: |
| 346 | if d[0] and d[1]: |
| 347 | reload_doc(d[1].lower(), 'DocType Mapper', d[0]) |
Rushabh Mehta | 2773940 | 2011-09-15 12:55:25 +0530 | [diff] [blame] | 348 | elif patch_no == 364: |
| 349 | sql("""delete from `tabField Mapper Detail` |
| 350 | where to_field in ('qty', 'amount', 'export_amount') |
| 351 | and parent in ('Sales Order-Receivable Voucher', 'Delivery Note-Receivable Voucher') |
| 352 | """) |
| 353 | mappers = sql("select name, module from `tabDocType Mapper`") |
| 354 | for d in mappers: |
| 355 | if d[0] and d[1]: |
| 356 | reload_doc(d[1].lower(), 'DocType Mapper', d[0]) |
| 357 | elif patch_no == 365: |
| 358 | from patches.delivery_billing_status_patch import run_patch |
| 359 | run_patch() |
Nabin Hait | fdb0e36 | 2011-09-19 12:22:47 +0530 | [diff] [blame] | 360 | elif patch_no == 367: |
Nabin Hait | 0b5f9b0 | 2011-09-16 14:32:23 +0530 | [diff] [blame] | 361 | bin = sql("select name from tabBin") |
| 362 | for b in bin: |
| 363 | bobj = get_obj('Bin',b[0]) |
Nabin Hait | 93ba4fb | 2011-11-08 15:30:04 +0530 | [diff] [blame] | 364 | bobj.update_entries_after(posting_date = '2011-09-01', posting_time = '01:00') |
Nabin Hait | fdb0e36 | 2011-09-19 12:22:47 +0530 | [diff] [blame] | 365 | elif patch_no == 368: |
Nabin Hait | b3ce0ec | 2011-09-22 16:10:15 +0530 | [diff] [blame] | 366 | from webnotes.utils import nestedset |
| 367 | t = [ |
| 368 | ['Account', 'parent_account'], ['Cost Center', 'parent_cost_center'], |
| 369 | ['Item Group', 'parent_item_group'], ['Territory', 'parent_territory'], |
| 370 | ['Customer Group', 'parent_customer_group'], ['Sales Person', 'parent_sales_person'] |
| 371 | ] |
| 372 | for d in t: |
| 373 | nestedset.rebuild_tree(d[0], d[1]) |
Nabin Hait | 7e97d1f | 2011-09-27 11:34:06 +0530 | [diff] [blame] | 374 | elif patch_no == 369: |
Nabin Hait | b3ce0ec | 2011-09-22 16:10:15 +0530 | [diff] [blame] | 375 | reload_doc('hr', 'doctype', 'appraisal') |
| 376 | reload_doc('hr', 'doctype', 'appraisal_detail') |
Nabin Hait | 7e97d1f | 2011-09-27 11:34:06 +0530 | [diff] [blame] | 377 | elif patch_no == 370: |
| 378 | sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'") |
Nabin Hait | b3ce0ec | 2011-09-22 16:10:15 +0530 | [diff] [blame] | 379 | elif patch_no == 371: |
Rushabh Mehta | ae4d1f9 | 2012-03-12 14:34:55 +0530 | [diff] [blame] | 380 | from webnotes.modules import reload_doc |
Nabin Hait | b30c4a6 | 2011-10-05 11:36:16 +0530 | [diff] [blame] | 381 | |
| 382 | reload_doc('setup', 'doctype','features_setup') |
| 383 | 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'] |
| 384 | |
| 385 | for f in flds: |
| 386 | val = sql("select value from tabSingles where field = '%s' and doctype = 'Features Setup'" % f) |
| 387 | val = val and val[0][0] or 0 |
| 388 | sql("update `tabSingles` set `value` = %s where `field` = '%s' and doctype = 'Features Setup'" % (val, '__'+f)) |
| 389 | |
| 390 | st = "'"+"', '".join(flds)+"'" |
| 391 | sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st) |
| 392 | sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st) |
| 393 | |
| 394 | get_obj('Features Setup', 'Features Setup').doc.save() |
Nabin Hait | 685564f | 2011-10-11 14:42:34 +0530 | [diff] [blame] | 395 | elif patch_no == 372: |
Rushabh Mehta | ae4d1f9 | 2012-03-12 14:34:55 +0530 | [diff] [blame] | 396 | from webnotes.modules import reload_doc |
Nabin Hait | b30c4a6 | 2011-10-05 11:36:16 +0530 | [diff] [blame] | 397 | |
| 398 | reload_doc('setup', 'doctype','features_setup') |
| 399 | 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'] |
| 400 | |
| 401 | for f in flds: |
| 402 | val = sql("select value from tabSingles where field = '%s' and doctype = 'Features Setup'" % f) |
| 403 | val = val and val[0][0] or 0 |
| 404 | sql("update `tabSingles` set `value` = %s where `field` = '%s' and doctype = 'Features Setup'" % (val, 'fs_'+f)) |
| 405 | |
| 406 | st = "'__"+"', '__".join(flds)+"'" |
| 407 | |
| 408 | sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st) |
| 409 | sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st) |
| 410 | |
| 411 | get_obj('Features Setup', 'Features Setup').doc.save() |
Nabin Hait | 685564f | 2011-10-11 14:42:34 +0530 | [diff] [blame] | 412 | elif patch_no == 373: |
Nabin Hait | a55eec1 | 2011-10-05 11:47:08 +0530 | [diff] [blame] | 413 | sql("delete from `tabDocField` where fieldname = 'item_searial_nos' and parent = 'Features Setup'") |
| 414 | sql("delete from `tabDefaultValue` where defkey = 'item_searial_nos' and parent = 'Control Panel'") |
Nabin Hait | 685564f | 2011-10-11 14:42:34 +0530 | [diff] [blame] | 415 | elif patch_no == 374: |
Nabin Hait | da50c08 | 2011-10-05 12:10:08 +0530 | [diff] [blame] | 416 | rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null") |
| 417 | from webnotes.model.code import get_obj |
| 418 | m = get_obj('Features Setup') |
| 419 | for d in rs: |
| 420 | m.doc.fields[d[0]] = 1 |
| 421 | m.doc.save() |
| 422 | m.validate() |
Nabin Hait | 685564f | 2011-10-11 14:42:34 +0530 | [diff] [blame] | 423 | elif patch_no == 375: |
Nabin Hait | 7a94186 | 2011-10-07 12:30:48 +0530 | [diff] [blame] | 424 | from webnotes.session_cache import clear_cache |
| 425 | clear_cache(webnotes.session['user']) |
Nabin Hait | 685564f | 2011-10-11 14:42:34 +0530 | [diff] [blame] | 426 | elif patch_no == 376: |
Nabin Hait | ddaa5a3 | 2011-10-07 12:36:13 +0530 | [diff] [blame] | 427 | reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt') |
Nabin Hait | 685564f | 2011-10-11 14:42:34 +0530 | [diff] [blame] | 428 | elif patch_no == 377: |
Nabin Hait | 8e54aa8 | 2011-10-07 19:03:19 +0530 | [diff] [blame] | 429 | 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'] |
| 430 | |
| 431 | st = "'"+"', '".join(flds)+"'" |
| 432 | sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st) |
| 433 | sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st) |
| 434 | |
| 435 | from webnotes.session_cache import clear_cache |
| 436 | clear_cache(webnotes.session['user']) |
Nabin Hait | 685564f | 2011-10-11 14:42:34 +0530 | [diff] [blame] | 437 | elif patch_no == 378: |
| 438 | comp = sql("select name from tabCompany where docstatus!=2") |
| 439 | fy = sql("select name from `tabFiscal Year` order by year_start_date asc") |
| 440 | for c in comp: |
| 441 | prev_fy = '' |
| 442 | for f in fy: |
| 443 | fy_obj = get_obj('Fiscal Year', f[0]) |
| 444 | fy_obj.doc.past_year = prev_fy |
| 445 | fy_obj.doc.company = c[0] |
| 446 | fy_obj.doc.save() |
| 447 | fy_obj.repost() |
| 448 | prev_fy = f[0] |
| 449 | sql("commit") |
| 450 | sql("start transaction") |
| 451 | elif patch_no == 379: |
| 452 | sql("update tabDocPerm set amend = 0 where parent = 'Salary Structure'") |
| 453 | sql("update tabDocPerm set cancel = 1 where parent = 'Company' and role = 'System Manager'") |
| 454 | elif patch_no == 380: |
| 455 | if sql("select count(name) from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1: |
| 456 | sql("delete from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1") |
| 457 | if sql("select count(name) from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1: |
| 458 | sql("delete from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1") |
| 459 | elif patch_no == 381: |
| 460 | reload_doc('accounts', 'doctype', 'internal_reconciliation') |
| 461 | reload_doc('accounts', 'doctype', 'ir_payment_detail') |
| 462 | reload_doc('accounts', 'Module Def', 'Accounts') |
| 463 | elif patch_no == 382: |
| 464 | if sql("select count(name) from `tabDocField` where label = 'Get Specification Details' and parent = 'QA Inspection Report' and fieldtype = 'Button'")[0][0] > 1: |
| 465 | sql("delete from `tabDocField` where label = 'Get Specification Details' and parent = 'QA Inspection Report' and fieldtype = 'Button' limit 1") |
Nabin Hait | 6a05616 | 2011-10-10 12:23:10 +0530 | [diff] [blame] | 466 | elif patch_no == 383: |
| 467 | reload_doc('accounts', 'doctype', 'cost_center') |
Nabin Hait | 15cad19 | 2011-10-10 17:10:24 +0530 | [diff] [blame] | 468 | elif patch_no == 384: |
| 469 | reload_doc('stock', 'Module Def', 'Stock') |
| 470 | sql("delete from `tabModule Def Item` where display_name = 'Serial No' and parent = 'Support'") |
| 471 | sql("update `tabDocType` set subject = 'Item Code: %(item_code)s, Warehouse: %(warehouse)s' where name = 'Serial No'") |
Nabin Hait | c1d4281 | 2011-10-11 12:50:55 +0530 | [diff] [blame] | 472 | elif patch_no == 385: |
| 473 | # Patch for adding packing related columns (packed by, checked by, shipping mark etc) |
| 474 | reload_doc('stock','doctype','delivery_note') |
Nabin Hait | 89a9a26 | 2011-10-12 12:41:00 +0530 | [diff] [blame] | 475 | elif patch_no == 386: |
| 476 | sql("update `tabDocField` set allow_on_submit = 1 where fieldname = 'page_break'") |
Nabin Hait | c7cf94e | 2011-10-12 13:16:11 +0530 | [diff] [blame] | 477 | elif patch_no == 387: |
| 478 | 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'") |
Nabin Hait | fe4c4f9 | 2011-10-13 11:07:14 +0530 | [diff] [blame] | 479 | elif patch_no == 388: |
Nabin Hait | d84ad94 | 2011-10-13 14:04:26 +0530 | [diff] [blame] | 480 | pass |