2013-11-20 07:29:58 +00:00
|
|
|
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
2013-08-05 09:29:54 +00:00
|
|
|
// License: GNU General Public License v3. See license.txt
|
2012-02-23 07:05:32 +00:00
|
|
|
|
2012-01-24 09:03:21 +00:00
|
|
|
/* features setup "Dictionary", "Script"
|
|
|
|
Dictionary Format
|
|
|
|
'projects': {
|
|
|
|
'Sales Order': {
|
|
|
|
'fields':['project_name'],
|
2014-12-25 10:31:55 +00:00
|
|
|
'items':['projected_qty']
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'Purchase Order': {
|
|
|
|
'fields':['project_name']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====================================================================*/
|
|
|
|
pscript.feature_dict = {
|
|
|
|
'fs_projects': {
|
2012-03-30 06:59:06 +00:00
|
|
|
'BOM': {'fields':['project_name']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Delivery Note': {'fields':['project_name']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Purchase Invoice': {'items':['project_name']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Production Order': {'fields':['project_name']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Purchase Order': {'items':['project_name']},
|
|
|
|
'Purchase Receipt': {'items':['project_name']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'fields':['project_name']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales Order': {'fields':['project_name']},
|
|
|
|
'Stock Entry': {'fields':['project_name']},
|
|
|
|
'Timesheet': {'timesheet_details':['project_name']}
|
|
|
|
},
|
|
|
|
'fs_discounts': {
|
2014-12-25 10:31:55 +00:00
|
|
|
'Delivery Note': {'items':['discount_percentage']},
|
|
|
|
'Quotation': {'items':['discount_percentage']},
|
|
|
|
'Sales Invoice': {'items':['discount_percentage']},
|
|
|
|
'Sales Order': {'items':['discount_percentage','price_list_rate']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_purchase_discounts': {
|
2014-12-25 10:31:55 +00:00
|
|
|
'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']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_brands': {
|
2014-12-25 10:31:55 +00:00
|
|
|
'Delivery Note': {'items':['brand']},
|
|
|
|
'Material Request': {'items':['brand']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Item': {'fields':['brand']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Purchase Order': {'items':['brand']},
|
|
|
|
'Purchase Invoice': {'items':['brand']},
|
|
|
|
'Quotation': {'items':['brand']},
|
|
|
|
'Sales Invoice': {'items':['brand']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales BOM': {'fields':['new_item_brand']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Sales Order': {'items':['brand']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Serial No': {'fields':['brand']}
|
|
|
|
},
|
|
|
|
'fs_after_sales_installations': {
|
2014-12-25 10:31:55 +00:00
|
|
|
'Delivery Note': {'fields':['installation_status','per_installed'],'items':['installed_qty']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_item_batch_nos': {
|
2014-12-25 10:31:55 +00:00
|
|
|
'Delivery Note': {'items':['batch_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Item': {'fields':['has_batch_no']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Purchase Receipt': {'items':['batch_no']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Quality Inspection': {'fields':['batch_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales and Pruchase Return Wizard': {'return_details':['batch_no']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Sales Invoice': {'items':['batch_no']},
|
|
|
|
'Stock Entry': {'items':['batch_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Stock Ledger Entry': {'fields':['batch_no']}
|
|
|
|
},
|
|
|
|
'fs_item_serial_nos': {
|
|
|
|
'Customer Issue': {'fields':['serial_no']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Delivery Note': {'items':['serial_no'],'packed_items':['serial_no']},
|
|
|
|
'Installation Note': {'items':['serial_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Item': {'fields':['has_serial_no']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Maintenance Schedule': {'items':['serial_no'],'schedules':['serial_no']},
|
|
|
|
'Maintenance Visit': {'purposes':['serial_no']},
|
|
|
|
'Purchase Receipt': {'items':['serial_no']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Quality Inspection': {'fields':['item_serial_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales and Pruchase Return Wizard': {'return_details':['serial_no']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Sales Invoice': {'items':['serial_no']},
|
|
|
|
'Stock Entry': {'items':['serial_no']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Stock Ledger Entry': {'fields':['serial_no']}
|
|
|
|
},
|
2012-06-07 13:39:17 +00:00
|
|
|
'fs_item_barcode': {
|
|
|
|
'Item': {'fields': ['barcode']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Delivery Note': {'items': ['barcode']},
|
|
|
|
'Sales Invoice': {'items': ['barcode']}
|
2012-06-07 13:39:17 +00:00
|
|
|
},
|
2012-01-24 09:03:21 +00:00
|
|
|
'fs_item_group_in_details': {
|
2014-12-25 10:31:55 +00:00
|
|
|
'Delivery Note': {'items':['item_group']},
|
|
|
|
'Opportunity': {'items':['item_group']},
|
|
|
|
'Material Request': {'items':['item_group']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Item': {'fields':['item_group']},
|
2012-03-30 06:59:06 +00:00
|
|
|
'Global Defaults': {'fields':['default_item_group']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Purchase Order': {'items':['item_group']},
|
|
|
|
'Purchase Receipt': {'items':['item_group']},
|
|
|
|
'Purchase Voucher': {'items':['item_group']},
|
|
|
|
'Quotation': {'items':['item_group']},
|
|
|
|
'Sales Invoice': {'items':['item_group']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales BOM': {'fields':['serial_no']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Sales Order': {'items':['item_group']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Serial No': {'fields':['item_group']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Sales Partner': {'targets':['item_group']},
|
|
|
|
'Sales Person': {'targets':['item_group']},
|
|
|
|
'Territory': {'targets':['item_group']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_page_break': {
|
2014-12-25 10:31:55 +00:00
|
|
|
'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']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_exports': {
|
2014-12-25 10:31:55 +00:00
|
|
|
'Delivery Note': {'fields':['conversion_rate','currency','grand_total','in_words','rounded_total'],'items':['base_price_list_rate','base_amount','base_rate']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'POS Setting': {'fields':['conversion_rate','currency']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Quotation': {'fields':['conversion_rate','currency','grand_total','in_words','rounded_total'],'items':['base_price_list_rate','base_amount','base_rate']},
|
|
|
|
'Sales Invoice': {'fields':['conversion_rate','currency','grand_total','in_words','rounded_total'],'items':['base_price_list_rate','base_amount','base_rate']},
|
2012-01-24 09:03:21 +00:00
|
|
|
'Sales BOM': {'fields':['currency']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Sales Order': {'fields':['conversion_rate','currency','grand_total','in_words','rounded_total'],'items':['base_price_list_rate','base_amount','base_rate']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
2014-05-02 10:15:10 +00:00
|
|
|
|
2012-01-24 09:03:21 +00:00
|
|
|
'fs_imports': {
|
2013-01-28 11:26:07 +00:00
|
|
|
'Purchase Invoice': {
|
|
|
|
'fields': ['conversion_rate', 'currency', 'grand_total',
|
|
|
|
'in_words', 'net_total', 'other_charges_added',
|
2014-05-02 10:15:10 +00:00
|
|
|
'other_charges_deducted'],
|
2014-12-25 10:31:55 +00:00
|
|
|
'items': ['base_price_list_rate', 'base_amount','base_rate']
|
2013-01-28 11:26:07 +00:00
|
|
|
},
|
|
|
|
'Purchase Order': {
|
2013-07-18 09:41:29 +00:00
|
|
|
'fields': ['conversion_rate','currency', 'grand_total',
|
2013-01-28 11:26:07 +00:00
|
|
|
'in_words', 'net_total', 'other_charges_added',
|
|
|
|
'other_charges_deducted'],
|
2014-12-25 10:31:55 +00:00
|
|
|
'items': ['base_price_list_rate', 'base_amount','base_rate']
|
2013-01-28 11:26:07 +00:00
|
|
|
},
|
|
|
|
'Purchase Receipt': {
|
|
|
|
'fields': ['conversion_rate', 'currency','grand_total', 'in_words',
|
|
|
|
'net_total', 'other_charges_added', 'other_charges_deducted'],
|
2014-12-25 10:31:55 +00:00
|
|
|
'items': ['base_price_list_rate','base_amount','base_rate']
|
2013-01-28 11:26:07 +00:00
|
|
|
},
|
|
|
|
'Supplier Quotation': {
|
|
|
|
'fields':['conversion_rate','currency']
|
|
|
|
}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
2014-05-02 10:15:10 +00:00
|
|
|
|
2012-01-24 09:03:21 +00:00
|
|
|
'fs_item_advanced': {
|
2014-12-26 06:11:15 +00:00
|
|
|
'Item': {'fields':['customer_items']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_sales_extras': {
|
|
|
|
'Address': {'fields':['sales_partner']},
|
|
|
|
'Contact': {'fields':['sales_partner']},
|
|
|
|
'Customer': {'fields':['sales_team']},
|
2014-08-21 10:54:49 +00:00
|
|
|
'Delivery Note': {'fields':['sales_team']},
|
2014-12-26 06:11:15 +00:00
|
|
|
'Item': {'fields':['customer_items']},
|
2014-08-21 10:54:49 +00:00
|
|
|
'Sales Invoice': {'fields':['sales_team']},
|
|
|
|
'Sales Order': {'fields':['sales_team']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_more_info': {
|
2013-03-14 04:37:59 +00:00
|
|
|
"Customer Issue": {"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']},
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_quality': {
|
2013-07-18 09:34:29 +00:00
|
|
|
'Item': {'fields':['inspection_criteria','inspection_required']},
|
2014-12-25 10:31:55 +00:00
|
|
|
'Purchase Receipt': {'items':['qa_no']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_manufacturing': {
|
2013-07-18 09:34:29 +00:00
|
|
|
'Item': {'fields':['manufacturing']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_pos': {
|
2012-03-30 06:59:06 +00:00
|
|
|
'Sales Invoice': {'fields':['is_pos']}
|
2012-01-24 09:03:21 +00:00
|
|
|
},
|
|
|
|
'fs_recurring_invoice': {
|
2013-07-18 09:34:29 +00:00
|
|
|
'Sales Invoice': {'fields': ['recurring_invoice']}
|
2012-01-24 09:03:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).bind('form_refresh', function() {
|
2013-07-18 09:34:29 +00:00
|
|
|
for(var sys_feat in sys_defaults) {
|
2014-05-02 10:15:10 +00:00
|
|
|
if(sys_defaults[sys_feat]=='0'
|
2013-03-14 04:37:59 +00:00
|
|
|
&& (sys_feat in pscript.feature_dict)) { //"Features to hide" exists
|
2013-07-18 09:34:29 +00:00
|
|
|
if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat]) {
|
|
|
|
for(var fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype]) {
|
2013-03-14 04:37:59 +00:00
|
|
|
if(fort=='fields') {
|
2012-01-24 09:03:21 +00:00
|
|
|
hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
|
2013-03-14 04:37:59 +00:00
|
|
|
} else if(cur_frm.fields_dict[fort]) {
|
2014-05-02 10:15:10 +00:00
|
|
|
cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort], false);
|
2013-03-14 04:37:59 +00:00
|
|
|
} else {
|
2014-04-14 10:55:30 +00:00
|
|
|
msgprint(__('Grid "')+fort+__('" does not exists'));
|
2013-03-14 04:37:59 +00:00
|
|
|
}
|
2012-01-24 09:03:21 +00:00
|
|
|
}
|
|
|
|
}
|
2013-03-14 04:37:59 +00:00
|
|
|
|
2012-01-24 09:03:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|