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,147 @@
// Module CRM
$import(SMS Control)
cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(user =='Guest'){
hide_field(['status', 'naming_series', 'order_lost_reason', 'customer', 'rating', 'fax', 'website', 'territory', 'TerritoryHelp', 'address_line1', 'address_line2', 'city', 'state', 'country', 'pincode', 'address', 'lead_owner', 'market_segment', 'industry', 'campaign_name', 'interested_in', 'company', 'fiscal_year', 'contact_by', 'contact_date', 'last_contact_date', 'contact_date_ref', 'to_discuss', 'More Info', 'follow_up', 'Communication History', 'cc_to', 'subject', 'message', 'Attachment Html', 'Create New File', 'lead_attachment_detail', 'Send Email', 'Email', 'Create Customer', 'Create Enquiry', 'Next Steps', 'transaction_date', 'type', 'source']);
doc.source = 'Website';
}
if(!doc.status) set_multiple(dt,dn,{status:'Open'});
if (!doc.date){
doc.date = date.obj_to_str(new Date());
}
// set naming series
if(user=='Guest') doc.naming_series = 'WebLead';
cur_frm.add_fetch('customer', 'customer_name', 'company_name');
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
// custom buttons
//---------------
cur_frm.clear_custom_buttons()
if(!doc.__islocal && !in_list(['Converted', 'Lead Lost'], doc.status)) {
cur_frm.add_custom_button('Create Customer', cur_frm.cscript['Create Customer']);
cur_frm.add_custom_button('Create Enquiry', cur_frm.cscript['Create Enquiry']);
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']);
}
}
// Client Side Triggers
// ===========================================================
// ************ Status ******************
cur_frm.cscript.status = function(doc, cdt, cdn){
cur_frm.cscript.refresh(doc, cdt, cdn);
}
/*
// *********** Country ******************
// This will show states belonging to country
cur_frm.cscript.country = function(doc, cdt, cdn) {
var mydoc=doc;
$c('runserverobj', args={'method':'check_state', 'docs':compress_doclist([doc])},
function(r,rt){
if(r.message) {
var doc = locals[mydoc.doctype][mydoc.name];
doc.state = '';
get_field(doc.doctype, 'state' , doc.name).options = r.message;
refresh_field('state');
}
}
);
}
*/
cur_frm.cscript.TerritoryHelp = function(doc,dt,dn){
var call_back = function(){
var sb_obj = new SalesBrowser();
sb_obj.set_val('Territory');
}
loadpage('Sales Browser',call_back);
}
// Create New File
// ===============================================================
cur_frm.cscript['Create New File'] = function(doc){
new_doc("File");
}
//Trigger in Item Table
//===================================
cur_frm.cscript.item_code=function(doc,cdt,cdn){
var d = locals[cdt][cdn];
if (d.item_code) { get_server_fields('get_item_detail',d.item_code,'lead_item_detail',doc,cdt,cdn,1);}
}
// Create New Customer
// ===============================================================
cur_frm.cscript['Create Customer'] = function(){
var doc = cur_frm.doc;
$c('runserverobj',args={ 'method':'check_status', 'docs':compress_doclist([doc])},
function(r,rt){
if(r.message == 'Converted'){
msgprint("This lead is already converted to customer");
}
else{
n = createLocal("Customer");
$c('dt_map', args={
'docs':compress_doclist([locals["Customer"][n]]),
'from_doctype':'Lead',
'to_doctype':'Customer',
'from_docname':doc.name,
'from_to_list':"[['Lead', 'Customer']]"
},
function(r,rt) {
loaddoc("Customer", n);
}
);
}
}
);
}
// send email
// ===============================================================
cur_frm.cscript['Send Email'] = function(doc,cdt,cdn){
if(doc.__islocal != 1){
$c_obj(make_doclist(doc.doctype, doc.name),'send_mail','',function(r,rt){});
}else{
msgprint("Please save lead first before sending email")
}
}
// Create New Enquiry
// ===============================================================
cur_frm.cscript['Create Enquiry'] = function(){
var doc = cur_frm.doc;
$c('runserverobj',args={ 'method':'check_status', 'docs':compress_doclist([doc])},
function(r,rt){
if(r.message == 'Converted'){
msgprint("This lead is now converted to customer. Please create enquiry on behalf of customer");
}
else{
n = createLocal("Enquiry");
$c('dt_map', args={
'docs':compress_doclist([locals["Enquiry"][n]]),
'from_doctype':'Lead',
'to_doctype':'Enquiry',
'from_docname':doc.name,
'from_to_list':"[['Lead', 'Enquiry']]"
}
, function(r,rt) {
loaddoc("Enquiry", n);
}
);
}
}
);
}
//get query select Territory
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
}

View File

@@ -0,0 +1,212 @@
# 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
# Autoname
# ---------
def autoname(self):
self.doc.name = make_autoname(self.doc.naming_series+'.#####')
#check status of lead
#------------------------
def check_status(self):
chk = sql("select status from `tabLead` where name=%s", self.doc.name)
chk = chk and chk[0][0] or ''
return cstr(chk)
# Gets states belonging cto country selected
# =====================================================================
#def check_state(self):
# return "\n" + "\n".join([i[0] for i in sql("select state_name from `tabState` where `tabState`.country='%s' " % self.doc.country)])
# Get item detail (will be removed later)
#=======================================
def get_item_detail(self,item_code):
it=sql("select item_name,brand,item_group,description,stock_uom from `tabItem` where name='%s'"%item_code)
if it:
ret = {
'item_name' : it and it[0][0] or '',
'brand' : it and it[0][1] or '',
'item_group' : it and it[0][2] or '',
'description': it and it[0][3] or '',
'uom' : it and it[0][4] or ''
}
return cstr(ret)
def validate(self):
import string
# Get Address
# ======================================================================
#if (self.doc.address_line1) or (self.doc.address_line2) or (self.doc.city) or (self.doc.state) or (self.doc.country) or (self.doc.pincode):
# address =["address_line1", "address_line2", "city", "state", "country", "pincode"]
# comp_address=''
# for d in address:
# if self.doc.fields[d]:
# comp_address += self.doc.fields[d] + "\n"
# if self.doc.website:
# comp_address += "Website : "+ self.doc.website
# self.doc.address = comp_address
if self.doc.status == 'Lead Lost' and not self.doc.order_lost_reason:
msgprint("Please Enter Order Lost Reason")
raise Exception
if self.doc.source == 'Campaign' and not self.doc.campaign_name and session['user'] != 'Guest':
msgprint("Please specify campaign name")
raise Exception
if self.doc.email_id:
if not validate_email_add(self.doc.email_id):
msgprint('Please enter valid email id.')
raise Exception
if not self.doc.naming_series:
if session['user'] == 'Guest':
so = sql("select options from `tabDocField` where parent = 'Lead' and fieldname = 'naming_series'")
#so = sql("select series_options from `tabNaming Series Options` where doc_type='Lead'")
if so:
sr = so[0][0].split("\n")
set(self.doc, 'naming_series', sr[0])
else:
msgprint("Please specify naming series")
raise Exception
def on_update(self):
# Add to calendar
# ========================================================================
if self.doc.contact_by:
self.add_calendar_event()
if session['user'] == 'Guest':
if self.doc.email_id:
self.send_email_notification()
if not self.doc.naming_series:
if session['user'] == 'Guest':
#so = sql("select series_options from `tabNaming Series Options` where doc_type='Lead'")
so = sql("select options from `tabDocField` where parent = 'Lead' and fieldname = 'naming_series'")
if so:
sr = so[0][0].split("\n")
set(self.doc, 'naming_series', sr[0])
else:
msgprint("Please specify naming series")
raise Exception
def send_email_notification(self):
if not validate_email_add(self.doc.email_id.strip(' ')):
msgprint('error:%s is not a valid email id' % self.doc.email_id.strip(' '))
raise Exception
else:
subject = 'Thank you for interest in erpnext'
sendmail([self.doc.email_id.strip(' ')], sender = sender_email[0][0], subject = subject , parts = [['text/html', self.get_notification_msg()]])
#sendmail(cc_list, sender = sender_email[0][0], subject = subject , parts = [['text/html', message]],attach=attach_list)
msgprint("Mail Sent")
def get_notification_msg(self):
t = """
<html>
<body>
Dear %s,<br><br>
Thank you for contacting us.<br><br>
You have left following message for us,<br>
%s
<br><br>
You will receive reply on this shortly.<br><br>
Cheers!
</body>
</html>
""" % (self.doc.lead_name, self.doc.remark)
return t
# Add to Calendar
# ===========================================================================
def add_calendar_event(self):
# delete any earlier event by this lead
sql("delete from tabEvent where ref_type='Lead' and ref_name=%s", self.doc.name)
in_calendar_of = self.doc.lead_owner
# get profile (id) if exists for contact_by
email_id = webnotes.conn.get_value('Sales Person', self.doc.contact_by, 'email_id')
if webnotes.conn.exists('Profile', email_id):
in_calendar_of = email_id
ev = Document('Event')
ev.owner = in_calendar_of
ev.description = 'Contact ' + cstr(self.doc.lead_name) + '.By : ' + cstr(self.doc.contact_by) + '.To Discuss : ' + cstr(self.doc.to_discuss)
ev.event_date = self.doc.contact_date
ev.event_hour = '10:00'
ev.event_type = 'Private'
ev.ref_type = 'Lead'
ev.ref_name = self.doc.name
ev.save(1)
#-----------------Email--------------------------------------------
def send_emails(self, email=[], subject='', message=''):
if email:
sendmail(email, sender = webnotes.user.name, subject = subject , parts = [['text/html', message]])
msgprint("Mail Sent")
self.add_in_follow_up(message,'Email')
#-------------------------Checking Sent Mails Details----------------------------------------------
def send_mail(self):
if not self.doc.subject or not self.doc.message:
msgprint("Please enter subject & message in their respective fields.")
elif not self.doc.email_id:
msgprint("Recipient not specified. Please add email id of lead in 'Email id' field provided in 'Contact Info' section.")
raise Exception
else :
self.send_emails([self.doc.email_id.strip(' ')], subject = self.doc.subject ,message = self.doc.message)
#---------------------- Add details in follow up table----------------
def add_in_follow_up(self,message,type):
import datetime
child = addchild( self.doc, 'follow_up', 'Follow up', 1, self.doclist)
child.date = datetime.datetime.now().date().strftime('%Y-%m-%d')
child.notes = message
child.follow_up_type = type
child.save()
#-------------------SMS----------------------------------------------
def send_sms(self):
if not self.doc.sms_message or not self.doc.mobile_no:
msgprint("Please enter mobile number in Basic Info Section and message in SMS Section ")
raise Exception
else:
receiver_list = []
if self.doc.mobile_no:
receiver_list.append(self.doc.mobile_no)
for d in getlist(self.doclist,'lead_sms_detail'):
if d.other_mobile_no:
receiver_list.append(d.other_mobile_no)
if receiver_list:
msgprint(get_obj('SMS Control', 'SMS Control').send_sms(receiver_list, self.doc.sms_message))
self.add_in_follow_up(self.doc.sms_message,'SMS')

View File

@@ -0,0 +1,787 @@
# DocType, Lead
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:09:07',
'docstatus': 0,
'modified': '2011-05-10 12:15:21',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1305009922',
'allow_trash': 1,
'colour': 'White:FFF',
'doctype': 'DocType',
'document_type': 'Master',
'module': 'Selling',
'name': '__common__',
'search_fields': 'lead_name,lead_owner,status',
'section_style': 'Tabbed',
'server_code_error': ' ',
'show_in_menu': 0,
'subject': '%(lead_name)s from %(company_name)s | To Discuss: %(to_discuss)s',
'tag_fields': 'status,source',
'version': 394
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Lead',
'parentfield': 'fields',
'parenttype': 'DocType'
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'Lead',
'parentfield': 'permissions',
'parenttype': 'DocType',
'read': 1
},
# DocType, Lead
{
'doctype': 'DocType',
'name': 'Lead'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 1,
'permlevel': 1,
'role': 'Sales User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm',
'idx': 2,
'permlevel': 1,
'role': 'Sales Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 3,
'permlevel': 0,
'role': 'Sales Manager',
'submit': 0,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 1,
'doctype': 'DocPerm',
'idx': 4,
'permlevel': 0,
'role': 'Sales User',
'submit': 0,
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 5,
'permlevel': 1,
'role': 'All'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 1,
'doctype': 'DocPerm',
'idx': 6,
'permlevel': 0,
'role': 'System Manager',
'submit': 0,
'write': 1
},
# DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'idx': 7,
'permlevel': 0,
'role': 'Guest',
'write': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 1,
'label': 'Basic Info',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 2,
'oldfieldtype': 'Column Break',
'permlevel': 0,
'width': '50%'
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'lead_name',
'fieldtype': 'Data',
'idx': 3,
'in_filter': 1,
'label': 'Contact Name',
'oldfieldname': 'lead_name',
'oldfieldtype': 'Data',
'permlevel': 0,
'reqd': 1,
'search_index': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'source',
'fieldtype': 'Select',
'idx': 4,
'in_filter': 1,
'label': 'Source',
'no_copy': 1,
'oldfieldname': 'source',
'oldfieldtype': 'Select',
'options': "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign\nWebsite",
'permlevel': 0,
'reqd': 1,
'search_index': 1,
'trigger': 'Client'
},
# DocField
{
'colour': 'White:FFF',
'depends_on': "eval:doc.source == 'Existing Customer'",
'doctype': 'DocField',
'fieldname': 'customer',
'fieldtype': 'Link',
'hidden': 0,
'idx': 5,
'label': 'From Customer',
'oldfieldname': 'customer',
'oldfieldtype': 'Link',
'options': 'Customer',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'depends_on': "eval:doc.source == 'Campaign'",
'description': 'Enter campaign name if the source of lead is campaign.',
'doctype': 'DocField',
'fieldname': 'campaign_name',
'fieldtype': 'Link',
'hidden': 0,
'idx': 6,
'label': 'Campaign Name',
'oldfieldname': 'campaign_name',
'oldfieldtype': 'Link',
'options': 'Campaign',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Name of organization from where lead has come',
'doctype': 'DocField',
'fieldname': 'company_name',
'fieldtype': 'Data',
'idx': 7,
'in_filter': 1,
'label': 'Company Name',
'oldfieldname': 'company_name',
'oldfieldtype': 'Data',
'permlevel': 0,
'reqd': 0,
'search_index': 1,
'trigger': 'Client'
},
# DocField
{
'colour': 'White:FFF',
'description': 'To manage multiple series please go to Setup > Manage Series',
'doctype': 'DocField',
'fieldname': 'naming_series',
'fieldtype': 'Select',
'idx': 8,
'label': 'Series',
'no_copy': 1,
'oldfieldname': 'naming_series',
'oldfieldtype': 'Select',
'options': '\nLEAD\nLEAD/10-11/\nLEAD/MUMBAI/',
'permlevel': 0,
'reqd': 0
},
# DocField
{
'colour': 'White:FFF',
'default': 'Open',
'doctype': 'DocField',
'fieldname': 'status',
'fieldtype': 'Select',
'idx': 9,
'in_filter': 1,
'label': 'Status',
'no_copy': 1,
'oldfieldname': 'status',
'oldfieldtype': 'Select',
'options': '\nOpen\nAttempted to Contact\nContact in Future\nContacted\nInterested\nNot interested\nLead Lost\nConverted',
'permlevel': 0,
'reqd': 1,
'search_index': 1,
'trigger': 'Client'
},
# DocField
{
'default': 'Today',
'description': 'The date at which current entry is made in system.',
'doctype': 'DocField',
'fieldname': 'transaction_date',
'fieldtype': 'Date',
'idx': 10,
'in_filter': 1,
'label': 'Lead Date',
'no_copy': 1,
'oldfieldname': 'transaction_date',
'oldfieldtype': 'Date',
'permlevel': 0,
'reqd': 1,
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 11,
'permlevel': 0,
'width': '50%'
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'type',
'fieldtype': 'Select',
'idx': 12,
'in_filter': 1,
'label': 'Lead Type',
'oldfieldname': 'type',
'oldfieldtype': 'Select',
'options': '\nClient\nChannel Partner\nConsultant',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'request_type',
'fieldtype': 'Select',
'idx': 13,
'label': 'Request Type',
'oldfieldname': 'request_type',
'oldfieldtype': 'Select',
'options': '\nProduct Enquiry\nRequest for Information\nSuggestions\nOther',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Probability of lead converting to customer',
'doctype': 'DocField',
'fieldname': 'rating',
'fieldtype': 'Select',
'idx': 14,
'in_filter': 1,
'label': 'Rating',
'oldfieldname': 'rating',
'oldfieldtype': 'Select',
'options': '\nHot\nWarm\nCold',
'permlevel': 0,
'reqd': 0,
'search_index': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'remark',
'fieldtype': 'Small Text',
'idx': 15,
'label': 'Remark',
'oldfieldname': 'remark',
'oldfieldtype': 'Text',
'permlevel': 0
},
# DocField
{
'allow_on_submit': 0,
'depends_on': "eval:doc.status == 'Lead Lost'",
'doctype': 'DocField',
'fieldname': 'order_lost_reason',
'fieldtype': 'Link',
'hidden': 0,
'idx': 16,
'label': 'Lost Reason',
'oldfieldname': 'order_lost_reason',
'oldfieldtype': 'Link',
'options': 'Order Lost Reason',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'trash_reason',
'fieldtype': 'Small Text',
'idx': 17,
'label': 'Trash Reason',
'no_copy': 1,
'oldfieldname': 'trash_reason',
'oldfieldtype': 'Small Text',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 18,
'label': 'Contact Info',
'oldfieldtype': 'Column Break',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'phone',
'fieldtype': 'Data',
'idx': 19,
'label': 'Phone',
'oldfieldname': 'contact_no',
'oldfieldtype': 'Data',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'mobile_no',
'fieldtype': 'Data',
'idx': 20,
'label': 'Mobile No.',
'oldfieldname': 'mobile_no',
'oldfieldtype': 'Data',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'email_id',
'fieldtype': 'Data',
'idx': 21,
'label': 'Email Id',
'oldfieldname': 'email_id',
'oldfieldtype': 'Data',
'permlevel': 0,
'reqd': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'fax',
'fieldtype': 'Data',
'idx': 22,
'label': 'Fax',
'oldfieldname': 'fax',
'oldfieldtype': 'Data',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'website',
'fieldtype': 'Data',
'idx': 23,
'label': 'Website',
'oldfieldname': 'website',
'oldfieldtype': 'Data',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': '<a href="javascript:cur_frm.cscript.TerritoryHelp();">To manage Territory, click here</a>',
'doctype': 'DocField',
'fieldname': 'territory',
'fieldtype': 'Link',
'idx': 24,
'label': 'Territory',
'oldfieldname': 'territory',
'oldfieldtype': 'Link',
'options': 'Territory',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 25,
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'address_line1',
'fieldtype': 'Data',
'idx': 26,
'label': 'Address Line 1',
'oldfieldname': 'address_line1',
'oldfieldtype': 'Data',
'permlevel': 0,
'print_hide': 1,
'reqd': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'address_line2',
'fieldtype': 'Data',
'idx': 27,
'label': 'Address Line 2',
'oldfieldname': 'address_line2',
'oldfieldtype': 'Data',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'city',
'fieldtype': 'Data',
'idx': 28,
'label': 'City',
'oldfieldname': 'city',
'oldfieldtype': 'Select',
'permlevel': 0,
'print_hide': 1,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'country',
'fieldtype': 'Select',
'idx': 29,
'label': 'Country',
'oldfieldname': 'country',
'oldfieldtype': 'Select',
'options': 'link:Country',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'trigger': 'Client'
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'state',
'fieldtype': 'Data',
'idx': 30,
'label': 'State',
'oldfieldname': 'state',
'oldfieldtype': 'Select',
'options': 'Suggest',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'pincode',
'fieldtype': 'Data',
'idx': 31,
'label': 'Pin Code',
'oldfieldname': 'pincode',
'oldfieldtype': 'Data',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 32,
'label': 'More Info',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'company',
'fieldtype': 'Link',
'idx': 33,
'label': 'Company',
'oldfieldname': 'company',
'oldfieldtype': 'Link',
'options': 'Company',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'default': '__user',
'doctype': 'DocField',
'fieldname': 'lead_owner',
'fieldtype': 'Link',
'idx': 34,
'in_filter': 1,
'label': 'Lead Owner',
'oldfieldname': 'lead_owner',
'oldfieldtype': 'Link',
'options': 'Profile',
'permlevel': 0,
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'market_segment',
'fieldtype': 'Select',
'hidden': 0,
'idx': 35,
'in_filter': 1,
'label': 'Market Segment',
'oldfieldname': 'market_segment',
'oldfieldtype': 'Select',
'options': '\nLower Income\nMiddle Income\nUpper Income',
'permlevel': 0,
'reqd': 0,
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'industry',
'fieldtype': 'Link',
'idx': 36,
'label': 'Industry',
'oldfieldname': 'industry',
'oldfieldtype': 'Link',
'options': 'Industry Type',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Your products or facilities in which the lead is interested',
'doctype': 'DocField',
'fieldname': 'interested_in',
'fieldtype': 'Data',
'idx': 37,
'label': 'Interested In',
'oldfieldname': 'interested_in',
'oldfieldtype': 'Data',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'fiscal_year',
'fieldtype': 'Select',
'hidden': 1,
'idx': 38,
'in_filter': 1,
'label': 'Fiscal Year',
'oldfieldname': 'fiscal_year',
'oldfieldtype': 'Select',
'options': 'link:Fiscal Year',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 39,
'oldfieldtype': 'Column Break',
'permlevel': 0,
'width': '50%'
},
# DocField
{
'allow_on_submit': 0,
'colour': 'White:FFF',
'description': 'Your sales person who will contact the lead in future',
'doctype': 'DocField',
'fieldname': 'contact_by',
'fieldtype': 'Link',
'hidden': 0,
'idx': 40,
'in_filter': 1,
'label': 'Next Contact By',
'oldfieldname': 'contact_by',
'oldfieldtype': 'Link',
'options': 'Profile',
'permlevel': 0,
'print_hide': 0,
'reqd': 0,
'width': '100px'
},
# DocField
{
'allow_on_submit': 0,
'colour': 'White:FFF',
'description': 'Your sales person will get a reminder on this date to contact the lead',
'doctype': 'DocField',
'fieldname': 'contact_date',
'fieldtype': 'Date',
'idx': 41,
'in_filter': 1,
'label': 'Next Contact Date',
'no_copy': 1,
'oldfieldname': 'contact_date',
'oldfieldtype': 'Date',
'permlevel': 0,
'reqd': 0,
'width': '100px'
},
# DocField
{
'colour': 'White:FFF',
'depends_on': 'eval:!doc.__islocal',
'description': 'Date on which the lead was last contacted',
'doctype': 'DocField',
'fieldname': 'last_contact_date',
'fieldtype': 'Date',
'idx': 42,
'label': 'Last Contact Date',
'no_copy': 1,
'oldfieldname': 'last_contact_date',
'oldfieldtype': 'Date',
'permlevel': 1,
'print_hide': 1
},
# DocField
{
'allow_on_submit': 0,
'doctype': 'DocField',
'fieldname': 'to_discuss',
'fieldtype': 'Small Text',
'idx': 43,
'label': 'To Discuss',
'no_copy': 1,
'oldfieldname': 'to_discuss',
'oldfieldtype': 'Small Text',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Keep a track of communication with this lead which will help for future reference.',
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 44,
'label': 'Communication History',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'allow_on_submit': 0,
'doctype': 'DocField',
'fieldname': 'follow_up',
'fieldtype': 'Table',
'idx': 45,
'label': 'Follow up',
'oldfieldname': 'follow_up',
'oldfieldtype': 'Table',
'options': 'Follow up',
'permlevel': 0
}
]