restructured erpnext and deleted unwanted

This commit is contained in:
nabinhait
2011-07-01 13:34:41 +05:30
parent c1c54c9400
commit ec097975d0
1280 changed files with 54494 additions and 88652 deletions

View File

View File

@@ -0,0 +1,87 @@
cur_frm.cscript.refresh = function(doc) {
if(cint(doc.is_local) && doc.has_serial_no) set_field_permlevel('has_serial_no', 1);
if(cint(doc.is_local) && doc.is_stock_item) set_field_permlevel('is_stock_item', 1);
}
cur_frm.fields_dict['default_bom'].get_query = function(doc) {
//var d = locals[this.doctype][this.docname];
return 'SELECT DISTINCT `tabBill Of Materials`.`name` FROM `tabBill Of Materials` WHERE `tabBill Of Materials`.`item` = "' + doc.item_code + '" AND `tabBill Of Materials`.`is_active` = "No" and `tabBill Of Materials`.docstatus != 2 AND `tabBill Of Materials`.%(key)s LIKE "%s" ORDER BY `tabBill Of Materials`.`name` LIMIT 50'
}
// Expense Account
// ---------------------------------
cur_frm.fields_dict['purchase_account'].get_query = function(doc){
return 'SELECT DISTINCT `tabAccount`.`name` FROM `tabAccount` WHERE `tabAccount`.`debit_or_credit`="Debit" AND `tabAccount`.`group_or_ledger`="Ledger" AND `tabAccount`.`docstatus`!=2 AND `tabAccount`.`is_pl_account` = "Yes" AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.`name` LIMIT 50'
}
// Income Account
// --------------------------------
cur_frm.fields_dict['default_income_account'].get_query = function(doc) {
return 'SELECT DISTINCT `tabAccount`.`name` FROM `tabAccount` WHERE `tabAccount`.`debit_or_credit`="Credit" AND `tabAccount`.`group_or_ledger`="Ledger" AND `tabAccount`.`is_pl_account` = "Yes" AND `tabAccount`.`docstatus`!=2 AND `tabAccount`.`account_type` ="Income Account" AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.`name` LIMIT 50'
}
// Purchase Cost Center
// -----------------------------
cur_frm.fields_dict['cost_center'].get_query = function(doc) {
return 'SELECT `tabCost Center`.`name` FROM `tabCost Center` WHERE `tabCost Center`.%(key)s LIKE "%s" AND `tabCost Center`.`group_or_ledger` = "Ledger" AND `tabCost Center`.`docstatus`!= 2 ORDER BY `tabCost Center`.`name` ASC LIMIT 50'
}
// Sales Cost Center
// -----------------------------
cur_frm.fields_dict['default_sales_cost_center'].get_query = function(doc) {
return 'SELECT `tabCost Center`.`name` FROM `tabCost Center` WHERE `tabCost Center`.%(key)s LIKE "%s" AND `tabCost Center`.`group_or_ledger` = "Ledger" AND `tabCost Center`.`docstatus`!= 2 ORDER BY `tabCost Center`.`name` ASC LIMIT 50'
}
cur_frm.fields_dict['item_tax'].grid.get_field("tax_type").get_query = function(doc, cdt, cdn) {
return 'SELECT `tabAccount`.`name` FROM `tabAccount` WHERE `tabAccount`.`account_type` in ("Tax", "Chargeable") and `tabAccount`.`docstatus` != 2 and `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.`name` DESC LIMIT 50'
}
cur_frm.cscript.tax_type = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
get_server_fields('get_tax_rate',d.tax_type,'item_tax',doc, cdt, cdn, 1);
}
//get query select item group
cur_frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` FROM `tabItem Group` WHERE `tabItem Group`.`is_group` = "No" AND `tabItem Group`.`docstatus`!= 2 AND `tabItem Group`.%(key)s LIKE "%s" ORDER BY `tabItem Group`.`name` ASC LIMIT 50'
}
cur_frm.cscript.IGHelp = function(doc,dt,dn){
var call_back = function(){
var sb_obj = new SalesBrowser();
sb_obj.set_val('Item Group');
}
loadpage('Sales Browser',call_back);
}
// for description from attachment
// takes the first attachment and creates
// a table with both image and attachment in HTML
// in the "alternate_description" field
cur_frm.cscript['Add Image'] = function(doc, dt, dn) {
if(!doc.file_list) {
msgprint('Please attach a file first!');
}
var f = doc.file_list.split('\n')[0];
var fname = f.split(',')[0];
var fid = f.split(',')[1];
if(!in_list(['jpg','jpeg','gif','png'], fname.split('.')[1].toLowerCase())) {
msgprint('File must be of extension jpg, jpeg, gif or png'); return;
}
doc.description_html = repl('<table style="width: 100%; table-layout: fixed;">'+
'<tr><td style="width:110px"><img src="%(imgurl)s" width="100px"></td>'+
'<td>%(desc)s</td></tr>'+
'</table>', {imgurl: wn.urllib.get_file_url(fid), desc:doc.description});
refresh_field('description_html');
}

172
stock/doctype/item/item.py Normal file
View File

@@ -0,0 +1,172 @@
# Please edit this list and import only required elements
import webnotes
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
from webnotes.model.doclist import getlist, copy_doclist
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
from webnotes import session, form, is_testing, msgprint, errprint
set = webnotes.conn.set
sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
in_transaction = webnotes.conn.in_transaction
convert_to_lists = webnotes.conn.convert_to_lists
# -----------------------------------------------------------------------------------------
class DocType:
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def get_tax_rate(self, tax_type):
rate = sql("select tax_rate from tabAccount where name = %s", tax_type)
ret = {
'tax_rate' : rate and flt(rate[0][0]) or 0
}
return str(ret)
def on_update(self):
bin = sql("select stock_uom from `tabBin` where item_code = '%s' " % self.doc.item_code)
if bin and cstr(bin[0][0]) != cstr(self.doc.stock_uom):
msgprint("Please Update Stock UOM with the help of Stock UOM Replace Utility.")
raise Exception
check_list = []
for d in getlist(self.doclist,'uom_conversion_details'):
if not self.doc.stock_uom:
msgprint("Please enter Stock UOM first.")
raise Exception
if cstr(d.uom) in check_list:
msgprint("UOM %s has been entered more than once in Conversion Factor Details." % cstr(d.uom))
raise Exception
if not cstr(d.uom) in check_list:
check_list.append(cstr(d.uom))
if cstr(d.uom) == cstr(self.doc.stock_uom):
if flt(d.conversion_factor) != 1:
msgprint("Conversion Fator of UOM : %s should be equal to 1. As UOM : %s is Stock UOM of Item: %s." % ( cstr(d.uom), cstr(d.uom), cstr(self.doc.name)))
raise Exception
# else set uom_exist as true
uom_exist='true'
elif cstr(d.uom) != cstr(self.doc.stock_uom) and flt(d.conversion_factor) == 1:
msgprint("Conversion Factor of UOM : %s should not be equal to 1. As UOM : %s is not Stock UOM of Item: %s." % ( cstr(d.uom), cstr(d.uom), cstr(self.doc.name)))
raise Exception
if not cstr(self.doc.stock_uom) in check_list :
child = addchild( self.doc, 'uom_conversion_details', 'UOM Conversion Detail', 1, self.doclist)
child.uom = self.doc.stock_uom
child.conversion_factor = 1
child.save()
# Check whether Ref Rate is not entered twice for same Price List and Currency
def check_ref_rate_detail(self):
check_list=[]
for d in getlist(self.doclist,'ref_rate_details'):
if [cstr(d.price_list_name),cstr(d.ref_currency)] in check_list:
msgprint("Ref Rate is entered twice for Price List : '%s' and Currency : '%s'." % (d.price_list_name,d.ref_currency))
raise Exception
else:
check_list.append([cstr(d.price_list_name),cstr(d.ref_currency)])
# Check whether Tax Rate is not entered twice for same Tax Type
def check_item_tax(self):
check_list=[]
for d in getlist(self.doclist,'item_tax'):
account_type = sql("select account_type from tabAccount where name = %s",d.tax_type)
account_type = account_type and account_type[0][0] or ''
if account_type not in ['Tax', 'Chargeable']:
msgprint("'%s' is not Tax / Chargeable Account"%(d.tax_type))
raise Exception, "Tax Account validation"
else:
if d.tax_type in check_list:
msgprint("Rate is entered twice for Tax : '%s'." % (d.tax_type))
raise Exception
else:
check_list.append(d.tax_type)
def check_for_active_boms(self, check):
if check in ['Is Active', 'Is Purchase Item']:
bom_mat = sql("select distinct t1.parent from `tabBOM Material` t1, `tabBill Of Materials` t2 where t1.item_code ='%s' and (t1.bom_no = '' or t1.bom_no is NULL) and t2.name = t1.parent and t2.is_active = 'Yes' and t2.docstatus = 1 and t1.docstatus =1 " % self.doc.name )
if bom_mat and bom_mat[0][0]:
msgprint("%s should be 'Yes'. As Item %s is present in one or many Active BOMs." % (cstr(check), cstr(self.doc.name)))
raise Exception
if check == 'Is Active' or ( check == 'Is Manufactured Item' and self.doc.is_sub_contracted_item != 'Yes') or (check == 'Is Sub Contracted Item' and self.doc.is_manufactured_item != 'Yes') :
bom = sql("select name from `tabBill Of Materials` where item = '%s' and is_active ='Yes'" % cstr(self.doc.name))
if bom and bom[0][0]:
msgprint("%s should be 'Yes'. As Item %s is present in one or many Active BOMs." % (cstr(check), cstr(self.doc.name)))
raise Exception
def validate(self):
fl = {'is_manufactured_item' :'Is Manufactured Item',
'is_sub_contracted_item':'Is Sub Contracted Item',
'is_purchase_item' :'Is Purchase Item',
'is_pro_applicable' :'Is Pro Applicable'}
for d in fl:
if cstr(self.doc.fields[d]) != 'Yes':
self.check_for_active_boms(check = fl[d])
self.check_ref_rate_detail()
self.check_item_tax()
if not self.doc.min_order_qty:
self.doc.min_order_qty = 0
self.check_non_asset_warehouse()
if self.doc.is_pro_applicable == 'Yes' and self.doc.is_manufactured_item != 'Yes':
msgprint("If making Production Order is allowed then, it should also allow to make Bill of Materials. Refer Manufacturing section.")
raise Exception
if self.doc.is_pro_applicable == 'Yes' and self.doc.is_stock_item == 'No':
msgprint("As Production Order can be made for this Item, then Is Stock Item Should be 'Yes' as we maintain it's stock. Refer Manufacturing and Inventory section.", raise_exception=1)
if self.doc.is_stock_item == "Yes" and not self.doc.default_warehouse:
msgprint("As we maintain stock of this item, its better to maintain default warehouse. To add default warehouse please go to 'Inventory' section. It will be fetched automatically while making Sales Order, Delivery Note, etc.. ", 1)
if self.doc.has_serial_no == 'Yes' and self.doc.is_stock_item == 'No':
msgprint("'Has Serial No' can not be 'Yes' for non-stock item", raise_exception=1)
def check_non_asset_warehouse(self):
if self.doc.is_asset_item == "Yes":
existing_qty = sql("select t1.warehouse, t1.actual_qty from tabBin t1, tabWarehouse t2 where t1.item_code=%s and (t2.warehouse_type!='Fixed Asset' or t2.warehouse_type is null) and t1.warehouse=t2.name and t1.actual_qty > 0", self.doc.name)
for e in existing_qty:
msgprint("%s Units exist in Warehouse %s, which is not an Asset Warehouse." % (e[1],e[0]))
if existing_qty:
msgprint("Please transfer the above quantities to an asset warehouse before changing this item to an asset item.")
self.doc.is_asset_item = 'No'
raise Exception
def check_min_inventory_level(self):
if self.doc.minimum_inventory_level:
total_qty = sql("select sum(projected_qty) from tabBin where item_code = %s",self.doc.name)
if flt(total_qty) < flt(self.doc.minimum_inventory_level):
msgprint("Your minimum inventory level is reached")
send_to = []
send = sql("select t1.email from `tabProfile` t1,`tabUserRole` t2 where t2.role IN ('Material Master Manager','Purchase Manager') and t2.parent = t1.name")
for d in send:
send_to.append(d[0])
msg = '''
Minimum Inventory Level Reached
Item Code: %s
Item Name: %s
Minimum Inventory Level: %s
Total Available Qty: %s
''' % (self.doc.item_code, self.doc.item_name, self.doc.minimum_inventory_level, total_qty)
sendmail(send_to, sender='automail@webnotestech.com', subject='Minimum Inventory Level Reached', parts=[['text/plain', msg]])
def get_file_details(self, arg = ''):
file = sql("select file_group, description from tabFile where name = %s", eval(arg)['file_name'], as_dict = 1)
ret = {
'file_group' : file and file[0]['file_group'] or '',
'description' : file and file[0]['description'] or ''
}
return str(ret)

936
stock/doctype/item/item.txt Normal file
View File

@@ -0,0 +1,936 @@
# DocType, Item
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:09:05',
'docstatus': 0,
'modified': '2011-05-30 15:22:32',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1308741898',
'allow_attach': 1,
'allow_trash': 1,
'autoname': 'field:item_code',
'colour': 'White:FFF',
'doctype': 'DocType',
'document_type': 'Master',
'max_attachments': 1,
'module': 'Stock',
'name': '__common__',
'search_fields': 'item_name,description,item_group',
'section_style': 'Tray',
'server_code_error': ' ',
'show_in_menu': 0,
'subject': '%(item_name)s',
'tag_fields': 'item_group',
'version': 153
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Item',
'parentfield': 'fields',
'parenttype': 'DocType'
},
# These values are common for all DocPerm
{
'amend': 0,
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'Item',
'parentfield': 'permissions',
'parenttype': 'DocType',
'read': 1,
'submit': 0
},
# DocType, Item
{
'doctype': 'DocType',
'name': 'Item'
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'permlevel': 0,
'role': 'Material User',
'write': 0
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 1,
'permlevel': 1,
'role': 'Material Manager',
'write': 0
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 2,
'permlevel': 0,
'role': 'Material Manager',
'write': 0
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 3,
'permlevel': 1,
'role': 'Material User',
'write': 0
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 5,
'permlevel': 0,
'role': 'Material Master Manager',
'write': 1
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 6,
'permlevel': 1,
'role': 'Material Master Manager',
'write': 0
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 7,
'permlevel': 0,
'role': 'System Manager',
'write': 1
},
# DocPerm
{
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 8,
'permlevel': 1,
'role': 'System Manager',
'write': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 1,
'label': 'Item',
'no_copy': 0,
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'trash_reason',
'fieldtype': 'Small Text',
'idx': 2,
'label': 'Trash Reason',
'oldfieldname': 'trash_reason',
'oldfieldtype': 'Small Text',
'permlevel': 1
},
# DocField
{
'colour': 'White:FFF',
'description': 'Item will be saved by this name in the data base.',
'doctype': 'DocField',
'fieldname': 'item_code',
'fieldtype': 'Data',
'idx': 3,
'in_filter': 0,
'label': 'Item Code',
'oldfieldname': 'item_code',
'oldfieldtype': 'Data',
'permlevel': 0,
'reqd': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_name',
'fieldtype': 'Data',
'idx': 4,
'in_filter': 1,
'label': 'Item Name',
'oldfieldname': 'item_name',
'oldfieldtype': 'Data',
'permlevel': 0,
'reqd': 1,
'search_index': 1
},
# DocField
{
'colour': 'White:FFF',
'description': 'Classify your item in any one item group by clicking on the magnifying glass',
'doctype': 'DocField',
'fieldname': 'item_group',
'fieldtype': 'Link',
'idx': 5,
'in_filter': 1,
'label': 'Item Group',
'oldfieldname': 'item_group',
'oldfieldtype': 'Link',
'options': 'Item Group',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'HTML',
'idx': 6,
'label': 'IGHelp',
'oldfieldtype': 'HTML',
'options': '<a href="javascript:cur_frm.cscript.IGHelp();">To manage Item Group, click here</a>',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'brand',
'fieldtype': 'Link',
'hidden': 0,
'idx': 7,
'label': 'Brand',
'oldfieldname': 'brand',
'oldfieldtype': 'Link',
'options': 'Brand',
'permlevel': 0,
'print_hide': 1,
'reqd': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 8,
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Text',
'idx': 9,
'in_filter': 0,
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Text',
'permlevel': 0,
'reqd': 1,
'search_index': 0,
'width': '300px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description_html',
'fieldtype': 'Text',
'idx': 10,
'label': 'Description HTML',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Generates HTML to include image (1st attachment) in the description',
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 12,
'label': 'Add Image',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 13,
'label': 'Inventory',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Enter unit of measurement in which stock of this item is maintained in your warehouse.',
'doctype': 'DocField',
'fieldname': 'stock_uom',
'fieldtype': 'Link',
'idx': 14,
'label': 'Default UoM',
'oldfieldname': 'stock_uom',
'oldfieldtype': 'Link',
'options': 'UOM',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'default': 'Yes',
'description': 'Select "Yes" if you are maintaining stock of this item in your Inventory.',
'doctype': 'DocField',
'fieldname': 'is_stock_item',
'fieldtype': 'Select',
'idx': 15,
'label': 'Is Stock Item',
'oldfieldname': 'is_stock_item',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'valuation_method',
'fieldtype': 'Select',
'idx': 16,
'label': 'Valuation Method',
'oldfieldname': 'valuation_method',
'oldfieldtype': 'Select',
'options': '\nFIFO\nMoving Average',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'default_warehouse',
'fieldtype': 'Link',
'idx': 17,
'label': 'Default Warehouse',
'oldfieldname': 'default_warehouse',
'oldfieldtype': 'Link',
'options': 'Warehouse',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Percentage variation in quantity to be allowed while receiving or delivering this item.',
'doctype': 'DocField',
'fieldname': 'tolerance',
'fieldtype': 'Currency',
'idx': 18,
'label': 'Allowance Percent',
'oldfieldname': 'tolerance',
'oldfieldtype': 'Currency',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 're_order_level',
'fieldtype': 'Currency',
'idx': 19,
'label': 'Re-Order Level',
'oldfieldname': 're_order_level',
'oldfieldtype': 'Currency',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'default': '0.00',
'description': 'If stock level for this item has reached the minimum inventory level, system will prompt you to raise an Indent (Purchase Requisition).',
'doctype': 'DocField',
'fieldname': 'minimum_inventory_level',
'fieldtype': 'Currency',
'idx': 20,
'label': 'Minimum Inventory Level',
'oldfieldname': 'minimum_inventory_level',
'oldfieldtype': 'Currency',
'permlevel': 0,
'reqd': 0
},
# DocField
{
'colour': 'White:FFF',
'default': '0.00',
'description': 'You can enter the minimum quantity of this item to be ordered.',
'doctype': 'DocField',
'fieldname': 'min_order_qty',
'fieldtype': 'Currency',
'hidden': 0,
'idx': 21,
'label': 'Minimum Order Qty',
'oldfieldname': 'min_order_qty',
'oldfieldtype': 'Currency',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 22,
'oldfieldtype': 'Column Break',
'permlevel': 0,
'width': '50%'
},
# DocField
{
'colour': 'White:FFF',
'default': 'No',
'description': 'Select "Yes" if this item is used for some internal purpose in your company.',
'doctype': 'DocField',
'fieldname': 'is_asset_item',
'fieldtype': 'Select',
'idx': 23,
'label': 'Is Asset Item',
'oldfieldname': 'is_asset_item',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'default': 'No',
'doctype': 'DocField',
'fieldname': 'has_batch_no',
'fieldtype': 'Select',
'idx': 24,
'label': 'Has Batch No',
'oldfieldname': 'has_batch_no',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'default': 'No',
'description': 'Selecting "Yes" will give a unique identity to each entity of this item which can be viewed in the Serial No master.',
'doctype': 'DocField',
'fieldname': 'has_serial_no',
'fieldtype': 'Select',
'idx': 25,
'label': 'Has Serial No',
'oldfieldname': 'has_serial_no',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'warranty_period',
'fieldtype': 'Data',
'idx': 26,
'label': 'Warranty Period (in days)',
'oldfieldname': 'warranty_period',
'oldfieldtype': 'Data',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'end_of_life',
'fieldtype': 'Date',
'idx': 27,
'label': 'End of Life',
'oldfieldname': 'end_of_life',
'oldfieldtype': 'Date',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 28,
'label': 'Purchase Details',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'default': 'Yes',
'description': 'Selecting "Yes" will allow this item to appear in Purchase Order , Purchase Receipt.',
'doctype': 'DocField',
'fieldname': 'is_purchase_item',
'fieldtype': 'Select',
'idx': 29,
'label': 'Is Purchase Item',
'oldfieldname': 'is_purchase_item',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'description': 'Lead Time days is number of days by which this item is expected in your warehouse. This days is fetched in Indent when you select this item.',
'doctype': 'DocField',
'fieldname': 'lead_time_days',
'fieldtype': 'Int',
'idx': 30,
'label': 'Lead Time Days',
'no_copy': 1,
'oldfieldname': 'lead_time_days',
'oldfieldtype': 'Int',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Default Purchase Account in which cost of the item will be debited.',
'doctype': 'DocField',
'fieldname': 'purchase_account',
'fieldtype': 'Link',
'idx': 31,
'label': 'Default Expense Account',
'oldfieldname': 'purchase_account',
'oldfieldtype': 'Link',
'options': 'Account',
'permlevel': 0,
'trigger': 'Client'
},
# DocField
{
'colour': 'White:FFF',
'description': 'Default Cost Center for tracking expense for this item.',
'doctype': 'DocField',
'fieldname': 'cost_center',
'fieldtype': 'Link',
'idx': 32,
'label': 'Default Cost Center',
'oldfieldname': 'cost_center',
'oldfieldtype': 'Link',
'options': 'Cost Center',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Buying Cost will be updated from Purchase Orders and Purchase Receipts. <br>The buying cost will calculated by moving average method.',
'doctype': 'DocField',
'fieldname': 'buying_cost',
'fieldtype': 'Currency',
'idx': 33,
'label': 'Buying Cost',
'no_copy': 1,
'oldfieldname': 'buying_cost',
'oldfieldtype': 'Currency',
'permlevel': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'last_purchase_rate',
'fieldtype': 'Currency',
'idx': 34,
'label': 'Last Purchase Rate',
'no_copy': 1,
'oldfieldname': 'last_purchase_rate',
'oldfieldtype': 'Currency',
'permlevel': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'standard_rate',
'fieldtype': 'Currency',
'idx': 35,
'label': 'Standard Rate',
'oldfieldname': 'standard_rate',
'oldfieldtype': 'Currency',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 36,
'oldfieldtype': 'Column Break',
'permlevel': 0,
'width': '50%'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'uom_conversion_details',
'fieldtype': 'Table',
'idx': 37,
'label': 'UOM Conversion Details',
'oldfieldname': 'uom_conversion_details',
'oldfieldtype': 'Table',
'options': 'UOM Conversion Detail',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 38,
'label': 'Sales Details',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'default': 'Yes',
'description': 'Selecting "Yes" will allow this item to figure in Sales Order, Delivery Note',
'doctype': 'DocField',
'fieldname': 'is_sales_item',
'fieldtype': 'Select',
'idx': 39,
'label': 'Is Sales Item',
'oldfieldname': 'is_sales_item',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'default': 'No',
'description': 'Select "Yes" if this item represents some work like training, designing, consulting etc.',
'doctype': 'DocField',
'fieldname': 'is_service_item',
'fieldtype': 'Select',
'idx': 40,
'label': 'Is Service Item',
'oldfieldname': 'is_service_item',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'default': 'No',
'description': 'Select "Yes" if this item is to be sent to a customer or received from a supplier as a sample. Delivery notes and Purchase Receipts will update stock levels but there will be no invoice against this item.',
'doctype': 'DocField',
'fieldname': 'is_sample_item',
'fieldtype': 'Select',
'idx': 41,
'label': 'Allow Samples',
'oldfieldname': 'is_sample_item',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'max_discount',
'fieldtype': 'Currency',
'idx': 42,
'label': 'Max Discount (%)',
'oldfieldname': 'max_discount',
'oldfieldtype': 'Currency',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'default_income_account',
'fieldtype': 'Link',
'idx': 43,
'label': 'Default Income Account',
'options': 'Account',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'default_sales_cost_center',
'fieldtype': 'Link',
'idx': 44,
'label': 'Cost Center',
'options': 'Cost Center',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'sales_rate',
'fieldtype': 'Currency',
'hidden': 1,
'idx': 45,
'label': 'Sales Rate',
'oldfieldname': 'sales_rate',
'oldfieldtype': 'Currency',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 46,
'oldfieldtype': 'Column Break',
'permlevel': 0,
'width': '50%'
},
# DocField
{
'colour': 'White:FFF',
'description': 'Create a price list from Price List master and enter standard ref rates against each of them. On selection of a price list in Quotation, Sales Order or Delivery Note, corresponding ref rate will be fetched for this item.',
'doctype': 'DocField',
'fieldname': 'ref_rate_details',
'fieldtype': 'Table',
'idx': 47,
'label': 'Ref Rate Details',
'oldfieldname': 'ref_rate_details',
'oldfieldtype': 'Table',
'options': 'Ref Rate Detail',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 48,
'label': 'Item Tax',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_tax',
'fieldtype': 'Table',
'idx': 49,
'label': 'Item Tax1',
'oldfieldname': 'item_tax',
'oldfieldtype': 'Table',
'options': 'Item Tax',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 50,
'label': 'Inspection Criteria',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'default': 'No',
'doctype': 'DocField',
'fieldname': 'inspection_required',
'fieldtype': 'Select',
'idx': 51,
'label': 'Inspection Required',
'no_copy': 0,
'oldfieldname': 'inspection_required',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_specification_details',
'fieldtype': 'Table',
'idx': 52,
'label': 'Item Specification Detail',
'oldfieldname': 'item_specification_details',
'oldfieldtype': 'Table',
'options': 'Item Specification Detail',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 53,
'label': 'Manufacturing',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'default': 'No',
'description': 'Selecting "Yes" will allow you to create Bill of Material showing raw material and operational costs incurred to manufacture this item.',
'doctype': 'DocField',
'fieldname': 'is_manufactured_item',
'fieldtype': 'Select',
'idx': 54,
'label': 'Allow Bill of Materials',
'oldfieldname': 'is_manufactured_item',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'default_bom',
'fieldtype': 'Link',
'idx': 55,
'label': 'Default BOM',
'no_copy': 1,
'oldfieldname': 'default_bom',
'oldfieldtype': 'Link',
'options': 'Bill Of Materials',
'permlevel': 1
},
# DocField
{
'colour': 'White:FFF',
'default': 'No',
'description': 'Selecting "Yes" will allow you to make a Production Order for this item.',
'doctype': 'DocField',
'fieldname': 'is_pro_applicable',
'fieldtype': 'Select',
'idx': 56,
'label': 'Allow Production Order',
'oldfieldname': 'is_pro_applicable',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'colour': 'White:FFF',
'default': 'No',
'description': 'Select "Yes" if you supply raw materials to your supplier to manufacture this item.',
'doctype': 'DocField',
'fieldname': 'is_sub_contracted_item',
'fieldtype': 'Select',
'idx': 57,
'label': 'Is Sub Contracted Item',
'oldfieldname': 'is_sub_contracted_item',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'item_attachments_details',
'fieldtype': 'Table',
'idx': 58,
'label': 'Item Attachments Details',
'oldfieldname': 'item_attachments_details',
'oldfieldtype': 'Table',
'options': 'Item Attachments Detail',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'file_list',
'fieldtype': 'Text',
'hidden': 1,
'idx': 59,
'label': 'File List',
'permlevel': 0,
'print_hide': 1
}
]