brotherton-erpnext/erpnext/patches/v7_0/remove_features_setup.py

27 lines
1.1 KiB
Python
Raw Normal View History

2016-05-11 11:17:14 +00:00
import frappe
from erpnext.setup.install import create_compact_item_print_custom_field
2016-05-12 09:52:59 +00:00
from frappe.utils import cint
2016-05-11 11:17:14 +00:00
def execute():
2016-05-12 09:52:59 +00:00
frappe.reload_doctype('Stock Settings')
stock_settings = frappe.get_doc('Stock Settings', 'Stock Settings')
stock_settings.show_barcode_field = cint(frappe.db.get_value("Features Setup", None, "fs_item_barcode"))
stock_settings.save()
2016-05-11 11:17:14 +00:00
create_compact_item_print_custom_field()
compact_item_print = frappe.db.get_value("Features Setup", None, "compact_item_print")
frappe.db.set_value("Print Settings", None, "compact_item_print", compact_item_print)
# remove defaults
frappe.db.sql("""delete from tabDefaultValue where defkey in ('fs_item_serial_nos',
'fs_item_batch_nos', 'fs_brands', 'fs_item_barcode',
'fs_item_advanced', 'fs_packing_details', 'fs_item_group_in_details',
'fs_exports', 'fs_imports', 'fs_discounts', 'fs_purchase_discounts',
'fs_after_sales_installations', 'fs_projects', 'fs_sales_extras',
'fs_recurring_invoice', 'fs_pos', 'fs_manufacturing', 'fs_quality',
'fs_page_break', 'fs_more_info', 'fs_pos_view', 'compact_item_print')""")
frappe.delete_doc('DocType', 'Features Setup')