Fieldname changed in Features Setup

This commit is contained in:
Nabin Hait 2011-10-05 11:26:46 +05:30
parent 5556cbe51d
commit cdb8255628
2 changed files with 40 additions and 23 deletions

View File

@ -1,7 +1,7 @@
# REMEMBER to update this # REMEMBER to update this
# ======================== # ========================
last_patch = 371 last_patch = 372
#------------------------------------------- #-------------------------------------------
@ -364,12 +364,12 @@ def execute(patch_no):
from webnotes.modules.module_manager import reload_doc from webnotes.modules.module_manager import reload_doc
reload_doc('setup', 'doctype','features_setup') reload_doc('setup', 'doctype','features_setup')
flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_serial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos'] 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']
for f in flds: for f in flds:
val = sql("select value from tabSingles where field = '%s' and doctype = 'Features Setup'" % f) val = sql("select value from tabSingles where field = '%s' and doctype = 'Features Setup'" % f)
val = val and val[0][0] or 0 val = val and val[0][0] or 0
sql("update `tabSingles` set value = %s where field = '%s' and doctype = 'Features Setup'" % (val, '__'+f)) sql("update `tabSingles` set `value` = %s where `field` = '%s' and doctype = 'Features Setup'" % (val, '__'+f))
st = "'"+"', '".join(flds)+"'" st = "'"+"', '".join(flds)+"'"
sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st) sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st)
@ -378,6 +378,23 @@ def execute(patch_no):
get_obj('Features Setup', 'Features Setup').doc.save() get_obj('Features Setup', 'Features Setup').doc.save()
elif patch_no == 372: elif patch_no == 372:
from webnotes.modules.module_manager import reload_doc
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']
for f in flds:
val = sql("select value from tabSingles where field = '%s' and doctype = 'Features Setup'" % f)
val = val and val[0][0] or 0
sql("update `tabSingles` set `value` = %s where `field` = '%s' and doctype = 'Features Setup'" % (val, 'fs_'+f))
st = "'__"+"', '__".join(flds)+"'"
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)
get_obj('Features Setup', 'Features Setup').doc.save()
elif patch_no == 373:
comp = sql("select name from tabCompany where docstatus!=2") comp = sql("select name from tabCompany where docstatus!=2")
fy = sql("select name from `tabFiscal Year` order by year_start_date asc") fy = sql("select name from `tabFiscal Year` order by year_start_date asc")
for c in comp: for c in comp:

View File

@ -5,14 +5,14 @@
{ {
'creation': '2011-09-07 11:59:05', 'creation': '2011-09-07 11:59:05',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-09-30 19:49:12', 'modified': '2011-10-05 10:50:17',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1317365120', '_last_update': '1317790484',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard', 'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
@ -22,7 +22,7 @@
'name_case': 'Title Case', 'name_case': 'Title Case',
'section_style': 'Simple', 'section_style': 'Simple',
'show_in_menu': 1, 'show_in_menu': 1,
'version': 19 'version': 21
}, },
# These values are common for all DocField # These values are common for all DocField
@ -78,7 +78,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.', 'description': 'To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__item_searial_nos', 'fieldname': 'fs_item_serial_nos',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Item Serial Nos' 'label': 'Item Serial Nos'
}, },
@ -88,7 +88,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'To track items in sales and purchase documents with batch nos<br><b>Preferred Industry: Chemicals etc</b>', 'description': 'To track items in sales and purchase documents with batch nos<br><b>Preferred Industry: Chemicals etc</b>',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__item_batch_nos', 'fieldname': 'fs_item_batch_nos',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Item Batch Nos' 'label': 'Item Batch Nos'
}, },
@ -98,7 +98,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'To track brand name in the following documents<br>\nDelivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No', 'description': 'To track brand name in the following documents<br>\nDelivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__brands', 'fieldname': 'fs_brands',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Brands' 'label': 'Brands'
}, },
@ -114,7 +114,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': '1. To maintain the customer wise item code and to make them searchable based on their code use this option', 'description': '1. To maintain the customer wise item code and to make them searchable based on their code use this option',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__item_advanced', 'fieldname': 'fs_item_advanced',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Item Advanced' 'label': 'Item Advanced'
}, },
@ -124,7 +124,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order', 'description': 'If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__packing_details', 'fieldname': 'fs_packing_details',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Packing Detials' 'label': 'Packing Detials'
}, },
@ -134,7 +134,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'To get Item Group in details table', 'description': 'To get Item Group in details table',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__item_group_in_details', 'fieldname': 'fs_item_group_in_details',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Item Groups in Details' 'label': 'Item Groups in Details'
}, },
@ -151,7 +151,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'All export related fields like currency, conversion rate, export total, export grand total etc are available in <br>\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.', 'description': 'All export related fields like currency, conversion rate, export total, export grand total etc are available in <br>\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__exports', 'fieldname': 'fs_exports',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Exports' 'label': 'Exports'
}, },
@ -161,7 +161,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'All import related fields like currency, conversion rate, import total, import grand total etc are available in <br>\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.', 'description': 'All import related fields like currency, conversion rate, import total, import grand total etc are available in <br>\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__imports', 'fieldname': 'fs_imports',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Imports' 'label': 'Imports'
}, },
@ -177,7 +177,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'Field available in Delivery Note, Quotation, Receivable Voucher, Sales Order', 'description': 'Field available in Delivery Note, Quotation, Receivable Voucher, Sales Order',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__discounts', 'fieldname': 'fs_discounts',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Discounts' 'label': 'Discounts'
}, },
@ -187,7 +187,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'To track any installation or commissioning related work after sales', 'description': 'To track any installation or commissioning related work after sales',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__after_sales_installations', 'fieldname': 'fs_after_sales_installations',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'After Sale Installations' 'label': 'After Sale Installations'
}, },
@ -196,7 +196,7 @@
{ {
'description': 'Available in \nBill Of Materials, Delivery Note, Payable Voucher, Production Order, Purchase Order, Purchase Receipt, Receivable Voucher, Sales Order, Stock Entry, Timesheet', 'description': 'Available in \nBill Of Materials, Delivery Note, Payable Voucher, Production Order, Purchase Order, Purchase Receipt, Receivable Voucher, Sales Order, Stock Entry, Timesheet',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__projects', 'fieldname': 'fs_projects',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Projects' 'label': 'Projects'
}, },
@ -206,7 +206,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity', 'description': 'If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__sales_extras', 'fieldname': 'fs_sales_extras',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Sales Extras' 'label': 'Sales Extras'
}, },
@ -223,7 +223,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'If you involve in manufacturing activity<br>\nEnables item <b>Is Manufactured</b>', 'description': 'If you involve in manufacturing activity<br>\nEnables item <b>Is Manufactured</b>',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__manufacturing', 'fieldname': 'fs_manufacturing',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Manufacturing' 'label': 'Manufacturing'
}, },
@ -239,7 +239,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'If you follow Quality Inspection<br>\nEnables item QA Required and QA No in Purchase Receipt', 'description': 'If you follow Quality Inspection<br>\nEnables item QA Required and QA No in Purchase Receipt',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__quality', 'fieldname': 'fs_quality',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Quality' 'label': 'Quality'
}, },
@ -249,7 +249,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'To enable <b>Point of Sale</b> features', 'description': 'To enable <b>Point of Sale</b> features',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__pos', 'fieldname': 'fs_pos',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Point of Sale' 'label': 'Point of Sale'
}, },
@ -266,7 +266,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page', 'description': 'If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__page_break', 'fieldname': 'fs_page_break',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'Page Break' 'label': 'Page Break'
}, },
@ -282,7 +282,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'Enables <b>More Info.</b> in all documents', 'description': 'Enables <b>More Info.</b> in all documents',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': '__more_info', 'fieldname': 'fs_more_info',
'fieldtype': 'Check', 'fieldtype': 'Check',
'label': 'More Info' 'label': 'More Info'
} }