[cleanup] remove Features Setup

This commit is contained in:
Rushabh Mehta 2016-05-11 16:47:14 +05:30
parent 2dd0581134
commit d42167e0e5
14 changed files with 45 additions and 1112 deletions

View File

@ -77,11 +77,6 @@ def get_data():
"label": _("Customize"),
"icon": "icon-glass",
"items": [
{
"type": "doctype",
"name": "Features Setup",
"description": _("Show / Hide features like Serial Nos, POS etc.")
},
{
"type": "doctype",
"name": "Authorization Rule",

View File

@ -12,7 +12,7 @@ def print_settings_for_item_table(doc):
}
doc.hide_in_print_layout = ["uom", "stock_uom"]
doc.flags.compact_item_print = cint(frappe.db.get_value("Features Setup", None, "compact_item_print"))
doc.flags.compact_item_print = cint(frappe.db.get_value("Print Settings", None, "compact_item_print"))
if doc.flags.compact_item_print:
doc.print_templates["description"] = "templates/print_formats/includes/item_table_description.html"

View File

@ -259,7 +259,8 @@ erpnext.patches.v6_20x.remove_fiscal_year_from_holiday_list
erpnext.patches.v6_24.map_customer_address_to_shipping_address_on_po
erpnext.patches.v6_27.fix_recurring_order_status
erpnext.patches.v6_20x.remove_customer_supplier_roles
erpnext.patches.v6_20x.update_product_bundle_description
erpnext.patches.v7_0.update_party_status
erpnext.patches.v7_0.update_item_projected
erpnext.patches.v6_20x.update_product_bundle_description
erpnext.patches.v7_0.fix_duplicate_icons
erpnext.patches.v7_0.remove_features_setup

View File

@ -1,5 +1,8 @@
from __future__ import unicode_literals
import frappe
from erpnext.setup.install import create_compact_item_print_custom_field
def execute():
frappe.db.set_value("Features Setup", None, "compact_item_print", 1)
create_compact_item_print_custom_field()
frappe.db.set_value("Print Settings", None, "compact_item_print", 1)

View File

@ -0,0 +1,24 @@
import frappe
from erpnext.setup.install import create_compact_item_print_custom_field
def execute():
if not frappe.db.get_value("Features Setup", None, "fs_item_barcode"):
# hide barcode fields
frappe.make_property_setter(dict(fieldname='barcode', property='hidden', value=1))
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')

View File

@ -8,7 +8,6 @@
],
"js/erpnext.min.js": [
"public/js/conf.js",
"public/js/feature_setup.js",
"public/js/utils.js",
"public/js/queries.js",
"public/js/sms_manager.js",

View File

@ -1,227 +0,0 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
/* features setup "Dictionary", "Script"
Dictionary Format
'projects': {
'Sales Order': {
'fields':['project'],
'items':['projected_qty']
},
'Purchase Order': {
'fields':['project']
}
}
// ====================================================================*/
frappe.provide("erpnext.feature_setup");
erpnext.feature_setup.feature_dict = {
'fs_projects': {
'BOM': {'fields':['project']},
'Delivery Note': {'fields':['project']},
'Purchase Invoice': {'items':['project']},
'Production Order': {'fields':['project']},
'Purchase Order': {'items':['project']},
'Purchase Receipt': {'items':['project']},
'Sales Invoice': {'fields':['project']},
'Sales Order': {'fields':['project']},
'Stock Entry': {'fields':['project']},
'Timesheet': {'timesheet_details':['project']}
},
'fs_discounts': {
'Delivery Note': {'items':['discount_percentage']},
'Quotation': {'items':['discount_percentage']},
'Sales Invoice': {'items':['discount_percentage']},
'Sales Order': {'items':['discount_percentage','price_list_rate']}
},
'fs_purchase_discounts': {
'Purchase Order': {'items':['base_price_list_rate', 'discount_percentage', 'price_list_rate']},
'Purchase Receipt': {'items':['base_price_list_rate', 'discount_percentage', 'price_list_rate']},
'Purchase Invoice': {'items':['base_price_list_rate', 'discount_percentage', 'price_list_rate']}
},
'fs_brands': {
'Delivery Note': {'items':['brand']},
'Material Request': {'items':['brand']},
'Item': {'fields':['brand']},
'Purchase Order': {'items':['brand']},
'Purchase Invoice': {'items':['brand']},
'Quotation': {'items':['brand']},
'Sales Invoice': {'items':['brand']},
'Product Bundle': {'fields':['new_item_brand']},
'Sales Order': {'items':['brand']},
'Serial No': {'fields':['brand']}
},
'fs_after_sales_installations': {
'Delivery Note': {'fields':['installation_status','per_installed'],'items':['installed_qty']}
},
'fs_item_batch_nos': {
'Delivery Note': {'items':['batch_no']},
'Item': {'fields':['has_batch_no']},
'Purchase Receipt': {'items':['batch_no']},
'Quality Inspection': {'fields':['batch_no']},
'Sales and Pruchase Return Wizard': {'return_details':['batch_no']},
'Sales Invoice': {'items':['batch_no']},
'Stock Entry': {'items':['batch_no']},
'Stock Ledger Entry': {'fields':['batch_no']}
},
'fs_item_serial_nos': {
'Warranty Claim': {'fields':['serial_no']},
'Delivery Note': {'items':['serial_no'],'packed_items':['serial_no']},
'Installation Note': {'items':['serial_no']},
'Item': {'fields':['has_serial_no']},
'Maintenance Schedule': {'items':['serial_no'],'schedules':['serial_no']},
'Maintenance Visit': {'purposes':['serial_no']},
'Purchase Receipt': {'items':['serial_no']},
'Quality Inspection': {'fields':['item_serial_no']},
'Sales and Pruchase Return Wizard': {'return_details':['serial_no']},
'Sales Invoice': {'items':['serial_no']},
'Stock Entry': {'items':['serial_no']},
'Stock Ledger Entry': {'fields':['serial_no']}
},
'fs_item_barcode': {
'Item': {'fields': ['barcode']},
'Delivery Note': {'items': ['barcode']},
'Sales Invoice': {'items': ['barcode']},
'Stock Entry': {'items': ['barcode']},
'Purchase Receipt': {'items': ['barcode']}
},
'fs_item_group_in_details': {
'Delivery Note': {'items':['item_group']},
'Opportunity': {'items':['item_group']},
'Material Request': {'items':['item_group']},
'Item': {'fields':['item_group']},
'Global Defaults': {'fields':['default_item_group']},
'Purchase Order': {'items':['item_group']},
'Purchase Receipt': {'items':['item_group']},
'Purchase Voucher': {'items':['item_group']},
'Quotation': {'items':['item_group']},
'Sales Invoice': {'items':['item_group']},
'Product Bundle': {'fields':['serial_no']},
'Sales Order': {'items':['item_group']},
'Serial No': {'fields':['item_group']},
'Sales Partner': {'targets':['item_group']},
'Sales Person': {'targets':['item_group']},
'Territory': {'targets':['item_group']}
},
'fs_page_break': {
'Delivery Note': {'items':['page_break'],'packed_items':['page_break']},
'Material Request': {'items':['page_break']},
'Purchase Order': {'items':['page_break']},
'Purchase Receipt': {'items':['page_break']},
'Purchase Voucher': {'items':['page_break']},
'Quotation': {'items':['page_break']},
'Sales Invoice': {'items':['page_break']},
'Sales Order': {'items':['page_break']}
},
'fs_exports': {
'Delivery Note': {
'fields': ['conversion_rate','currency','base_grand_total','base_in_words','base_rounded_total',
'base_total', 'base_net_total', 'base_discount_amount', 'base_total_taxes_and_charges'],
'items': ['base_price_list_rate','base_amount','base_rate', 'base_net_rate', 'base_net_amount']
},
'POS Profile': {'fields':['conversion_rate','currency']},
'Quotation': {
'fields': ['conversion_rate','currency','base_grand_total','base_in_words','base_rounded_total',
'base_total', 'base_net_total', 'base_discount_amount', 'base_total_taxes_and_charges'],
'items': ['base_price_list_rate','base_amount','base_rate', 'base_net_rate', 'base_net_amount']
},
'Sales Invoice': {
'fields': ['conversion_rate','currency','base_grand_total','base_in_words','base_rounded_total',
'base_total', 'base_net_total', 'base_discount_amount', 'base_total_taxes_and_charges'],
'items': ['base_price_list_rate','base_amount','base_rate', 'base_net_rate', 'base_net_amount']
},
'Product Bundle': {'fields':['currency']},
'Sales Order': {
'fields': ['conversion_rate','currency','base_grand_total','base_in_words','base_rounded_total',
'base_total', 'base_net_total', 'base_discount_amount', 'base_total_taxes_and_charges'],
'items': ['base_price_list_rate','base_amount','base_rate', 'base_net_rate', 'base_net_amount']
}
},
'fs_imports': {
'Purchase Invoice': {
'fields': ['conversion_rate', 'currency', 'base_grand_total', 'base_discount_amount',
'base_in_words', 'base_total', 'base_net_total', 'base_taxes_and_charges_added',
'base_taxes_and_charges_deducted', 'base_total_taxes_and_charges'],
'items': ['base_price_list_rate', 'base_amount','base_rate', 'base_net_rate', 'base_net_amount']
},
'Purchase Order': {
'fields': ['conversion_rate','currency', 'base_grand_total', 'base_discount_amount',
'base_in_words', 'base_total', 'base_net_total', 'base_taxes_and_charges_added',
'base_taxes_and_charges_deducted', 'base_total_taxes_and_charges'],
'items': ['base_price_list_rate', 'base_amount','base_rate', 'base_net_rate', 'base_net_amount']
},
'Purchase Receipt': {
'fields': ['conversion_rate', 'currency','base_grand_total', 'base_in_words', 'base_total',
'base_net_total', 'base_taxes_and_charges_added', 'base_taxes_and_charges_deducted',
'base_total_taxes_and_charges', 'base_discount_amount'],
'items': ['base_price_list_rate','base_amount','base_rate', 'base_net_rate', 'base_net_amount']
},
'Supplier Quotation': {
'fields': ['conversion_rate', 'currency','base_grand_total', 'base_in_words', 'base_total',
'base_net_total', 'base_taxes_and_charges_added', 'base_taxes_and_charges_deducted',
'base_total_taxes_and_charges', 'base_discount_amount'],
'items': ['base_price_list_rate','base_amount','base_rate', 'base_net_rate', 'base_net_amount']
}
},
'fs_item_advanced': {
'Item': {'fields':['customer_items']}
},
'fs_sales_extras': {
'Address': {'fields':['sales_partner']},
'Contact': {'fields':['sales_partner']},
'Customer': {'fields':['sales_team']},
'Delivery Note': {'fields':['sales_team']},
'Item': {'fields':['customer_items']},
'Sales Invoice': {'fields':['sales_team']},
'Sales Order': {'fields':['sales_team']}
},
'fs_more_info': {
"Warranty Claim": {"fields": ["more_info"]},
'Material Request': {'fields':['more_info']},
'Lead': {'fields':['more_info']},
'Opportunity': {'fields':['more_info']},
'Purchase Invoice': {'fields':['more_info']},
'Purchase Order': {'fields':['more_info']},
'Purchase Receipt': {'fields':['more_info']},
'Supplier Quotation': {'fields':['more_info']},
'Quotation': {'fields':['more_info']},
'Sales Invoice': {'fields':['more_info']},
'Sales Order': {'fields':['more_info']},
'Delivery Note': {'fields':['more_info']},
},
'fs_quality': {
'Item': {'fields':['inspection_criteria','inspection_required']},
'Purchase Receipt': {'items':['qa_no']}
},
'fs_manufacturing': {
'Item': {'fields':['manufacturing']}
},
'fs_pos': {
'Sales Invoice': {'fields':['is_pos']}
},
'fs_recurring_invoice': {
'Sales Invoice': {'fields': ['recurring_invoice']}
}
}
$(document).bind('form_refresh', function() {
var feature_dict = erpnext.feature_setup.feature_dict;
for(var sys_feat in sys_defaults) {
if(sys_defaults[sys_feat]=='0'
&& (sys_feat in feature_dict)) { //"Features to hide" exists
if(cur_frm.doc.doctype in feature_dict[sys_feat]) {
for(var fort in feature_dict[sys_feat][cur_frm.doc.doctype]) {
if(fort=='fields') {
hide_field(feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
} else if(cur_frm.fields_dict[fort]) {
cur_frm.fields_dict[fort].grid.set_column_disp(feature_dict[sys_feat][cur_frm.doc.doctype][fort], false);
} else {
msgprint(__('Grid "')+fort+__('" does not exists'));
}
}
}
}
}
})

View File

@ -1 +0,0 @@
Settings for enabling / disabling certain features that will result in smaller forms.

View File

@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@ -1,5 +0,0 @@
frappe.ui.form.on('Features Setup', {
refresh: function(frm) {
}
});

View File

@ -1,833 +0,0 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2012-12-20 12:50:49",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "materials",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"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.",
"fieldname": "fs_item_serial_nos",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Serial Nos",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To track items in sales and purchase documents with batch nos. \"Preferred Industry: Chemicals\"",
"fieldname": "fs_item_batch_nos",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Batch Nos",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To track brand name in the following documents Delivery Note, Opportunity, Material Request, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Sales Invoice, Product Bundle, Sales Order, Serial No",
"fieldname": "fs_brands",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Brands",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To track items using barcode. You will be able to enter items in Delivery Note and Sales Invoice by scanning barcode of item.",
"fieldname": "fs_item_barcode",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Barcode",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To maintain the customer wise item code and to make them searchable based on their code use this option",
"fieldname": "fs_item_advanced",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Advanced",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To get Item Group in details table",
"fieldname": "fs_item_group_in_details",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Groups in Details",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "If checked, only Description, Quantity, Rate and Amount are shown in print of Item table. Any extra field is shown under 'Description' column.",
"fieldname": "compact_item_print",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Compact Item Print",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "sales_and_purchase",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales and Purchase",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "All export related fields like currency, conversion rate, export total, export grand total etc are available in Delivery Note, POS, Quotation, Sales Invoice, Sales Order etc.",
"fieldname": "fs_exports",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Exports",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "All import related fields like currency, conversion rate, import total, import grand total etc are available in Purchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.",
"fieldname": "fs_imports",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Imports",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Field available in Delivery Note, Quotation, Sales Invoice, Sales Order",
"fieldname": "fs_discounts",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Discounts",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Discount Fields will be available in Purchase Order, Purchase Receipt, Purchase Invoice",
"fieldname": "fs_purchase_discounts",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Purchase Discounts",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To track any installation or commissioning related work after sales",
"fieldname": "fs_after_sales_installations",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "After Sale Installations",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Available in BOM, Delivery Note, Purchase Invoice, Production Order, Purchase Order, Purchase Receipt, Sales Invoice, Sales Order, Stock Entry, Timesheet",
"fieldname": "fs_projects",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Projects",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity",
"fieldname": "fs_sales_extras",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Extras",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "accounts",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Accounts",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Check if you need automatic recurring invoices. After submitting any sales invoice, Recurring section will be visible.",
"fieldname": "fs_recurring_invoice",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Recurring Invoice",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To enable \"Point of Sale\" features",
"fieldname": "fs_pos",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Point of Sale",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To enable \"Point of Sale\" view",
"fieldname": "fs_pos_view",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "POS View",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "production",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Manufacturing",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "If you involve in manufacturing activity. Enables Item 'Is Manufactured'",
"fieldname": "fs_manufacturing",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Manufacturing",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break3",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "If you follow Quality Inspection. Enables Item QA Required and QA No in Purchase Receipt",
"fieldname": "fs_quality",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Quality",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "miscelleneous",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Miscelleneous",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"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",
"fieldname": "fs_page_break",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Page Break",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break4",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "fs_more_info",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-glass",
"idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2016-04-06 03:45:40.152486",
"modified_by": "Administrator",
"module": "Setup",
"name": "Features Setup",
"name_case": "Title Case",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 0,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 0,
"role": "Administrator",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
}
],
"read_only": 0,
"read_only_onload": 0,
"sort_order": "ASC",
"track_seen": 0
}

View File

@ -1,17 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class FeaturesSetup(Document):
def validate(self):
"""
update settings in defaults
"""
from frappe.model import default_fields
from frappe.utils import set_default
for key in self.meta.get_valid_columns():
if key not in default_fields:
set_default(key, self.get(key))

View File

@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
default_mail_footer = """<div style="padding: 7px; text-align: right; color: #888"><small>Sent via
<a style="color: #888" href="http://erpnext.org">ERPNext</a></div>"""
@ -11,7 +12,7 @@ default_mail_footer = """<div style="padding: 7px; text-align: right; color: #88
def after_install():
frappe.get_doc({'doctype': "Role", "role_name": "Analytics"}).insert()
set_single_defaults()
feature_setup()
create_compact_item_print_custom_field()
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
add_all_roles_to("Administrator")
frappe.db.commit()
@ -24,23 +25,6 @@ def check_setup_wizard_not_completed():
print
return False
def feature_setup():
"""save global defaults and features setup"""
doc = frappe.get_doc("Features Setup", "Features Setup")
doc.flags.ignore_permissions = True
# store value as 1 for all these fields
flds = ['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'
]
for f in flds:
doc.set(f, 1)
doc.save()
def set_single_defaults():
for dt in frappe.db.sql_list("""select name from `tabDocType` where issingle=1"""):
default_values = frappe.db.sql("""select fieldname, `default` from `tabDocField`
@ -55,3 +39,13 @@ def set_single_defaults():
pass
frappe.db.set_default("date_format", "dd-mm-yyyy")
def create_compact_item_print_custom_field():
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
create_custom_field('Print Settings', {
'label': _('Compact Item Print'),
'fieldname': 'compact_item_print',
'fieldtype': 'Check',
'default': 1,
'insert_after': 'with_letterhead'
})

View File

@ -21,7 +21,8 @@ domains = {
'Expense Claim', 'Employee'],
'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Maintenance User'],
'properties': [
{'doctype': 'Item', 'fieldname': 'is_stock_item', 'property': 'default', 'value': 0}
{'doctype': 'Item', 'fieldname': 'is_stock_item', 'property': 'default', 'value': 0},
{'fieldname': 'barcode', 'property': 'hidden', 'value': 1}
]
}
}