maintenance visit cleanup and integrated with maintenance schedule

This commit is contained in:
Nabin Hait 2012-06-27 13:21:12 +05:30
parent b81aa88091
commit 490ae41cee
4 changed files with 415 additions and 290 deletions

View File

@ -0,0 +1,99 @@
# DocType Mapper, Maintenance Schedule-Maintenance Visit
[
# These values are common in all dictionaries
{
'creation': '2012-06-27 13:18:25',
'docstatus': 0,
'modified': '2012-06-27 13:18:25',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Table Mapper Detail
{
'doctype': u'Table Mapper Detail',
'name': '__common__',
'parent': u'Maintenance Schedule-Maintenance Visit',
'parentfield': u'table_mapper_details',
'parenttype': u'DocType Mapper',
'validation_logic': u'docstatus=1'
},
# These values are common for all Field Mapper Detail
{
'doctype': u'Field Mapper Detail',
'map': u'Yes',
'name': '__common__',
'parent': u'Maintenance Schedule-Maintenance Visit',
'parentfield': u'field_mapper_details',
'parenttype': u'DocType Mapper'
},
# These values are common for all DocType Mapper
{
'doctype': u'DocType Mapper',
'from_doctype': u'Maintenance Schedule',
'module': u'Support',
'name': '__common__',
'ref_doc_submitted': 1,
'to_doctype': u'Maintenance Visit'
},
# DocType Mapper, Maintenance Schedule-Maintenance Visit
{
'doctype': u'DocType Mapper',
'name': u'Maintenance Schedule-Maintenance Visit'
},
# Field Mapper Detail
{
'checking_operator': u'=',
'doctype': u'Field Mapper Detail',
'from_field': u'customer',
'match_id': 0,
'to_field': u'customer'
},
# Field Mapper Detail
{
'doctype': u'Field Mapper Detail',
'from_field': u'name',
'match_id': 0,
'to_field': u'maintenance_schedule'
},
# Field Mapper Detail
{
'doctype': u'Field Mapper Detail',
'from_field': u'parent',
'match_id': 1,
'to_field': u'prevdoc_docname'
},
# Field Mapper Detail
{
'doctype': u'Field Mapper Detail',
'from_field': u'parenttype',
'match_id': 1,
'to_field': u'prevdoc_doctype'
},
# Table Mapper Detail
{
'doctype': u'Table Mapper Detail',
'from_field': u'item_maintenance_detail',
'from_table': u'Maintenance Schedule Item',
'match_id': 1,
'to_field': u'maintenance_visit_details',
'to_table': u'Maintenance Visit Purpose'
},
# Table Mapper Detail
{
'doctype': u'Table Mapper Detail',
'from_table': u'Maintenance Schedule',
'match_id': 0,
'to_table': u'Maintenance Visit'
}
]

View File

@ -16,16 +16,19 @@
cur_frm.cscript.onload = function(doc, dt, dn) { cur_frm.cscript.onload = function(doc, dt, dn) {
if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); if(!doc.status) set_multiple(dt,dn,{status:'Draft'});
if(doc.customer) cur_frm.cscript.customer(doc,cdt,cdn); if(doc.__islocal) set_multiple(dt,dn,{mntc_date:get_today()});
hide_contact_info(doc);
if(doc.__islocal){
set_multiple(dt,dn,{mntc_date:get_today()});
hide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']);
}
//if(doc.maintenance_type) cur_frm.cscript.maintenance_type(doc,cdt,cdn);
} }
var hide_contact_info = function(doc) {
if(doc.customer) $(cur_frm.fields_dict.contact_info_section.row.wrapper).toggle(true);
else $(cur_frm.fields_dict.contact_info_section.row.wrapper).toggle(false);
}
cur_frm.cscript.refresh = function(doc) {
hide_contact_info(doc);
}
//customer //customer
cur_frm.cscript.customer = function(doc,dt,dn) { cur_frm.cscript.customer = function(doc,dt,dn) {
@ -35,7 +38,7 @@ cur_frm.cscript.customer = function(doc,dt,dn) {
} }
if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', '', callback); if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', '', callback);
if(doc.customer) unhide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']); hide_contact_info(doc);
} }
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) { cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
@ -62,36 +65,12 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
cur_frm.cscript.get_items = function(doc, dt, dn) { cur_frm.cscript.get_items = function(doc, dt, dn) {
var callback = function(r,rt) { var callback = function(r,rt) {
unhide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']); hide_contact_info(doc);
cur_frm.refresh(); cur_frm.refresh();
} }
get_server_fields('fetch_items','','',doc, dt, dn,1,callback); get_server_fields('fetch_items','','',doc, dt, dn,1,callback);
} }
/*
cur_frm.cscript.maintenance_type = function(doc,cdt,cdn){
if(doc.maintenance_type == 'Scheduled') {
hide_field('sales_order_no');
hide_field('customer_issue_no');
hide_field('Get Items');
doc.customer_issue_no = '';
doc.sales_order_no = '';
}
else if(doc.maintenance_type == 'Unscheduled') {
unhide_field('sales_order_no');
hide_field('customer_issue_no');
unhide_field('Get Items');
doc.customer_issue_no = '';
}
else if(doc.maintenance_type == 'Breakdown') {
hide_field('sales_order_no');
unhide_field('customer_issue_no');
unhide_field('Get Items');
doc.sales_order_no = '';
}
}*/
cur_frm.fields_dict['maintenance_visit_details'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['maintenance_visit_details'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) {
return 'SELECT tabItem.name,tabItem.item_name,tabItem.description FROM tabItem WHERE tabItem.is_service_item="Yes" AND tabItem.docstatus != 2 AND tabItem.%(key)s LIKE "%s" LIMIT 50'; return 'SELECT tabItem.name,tabItem.item_name,tabItem.description FROM tabItem WHERE tabItem.is_service_item="Yes" AND tabItem.docstatus != 2 AND tabItem.%(key)s LIKE "%s" LIMIT 50';
} }
@ -110,7 +89,6 @@ cur_frm.fields_dict['sales_order_no'].get_query = function(doc) {
if(doc.customer) { if(doc.customer) {
cond = '`tabSales Order`.customer = "'+doc.customer+'" AND'; cond = '`tabSales Order`.customer = "'+doc.customer+'" AND';
} }
//return repl('SELECT DISTINCT `tabSales Order`.name FROM `tabSales Order`, `tabSales Order Item` WHERE `tabSales Order`.company = "%(company)s" AND `tabSales Order`.docstatus = 1 AND %(cond)s `tabSales Order`.name LIKE "%s" ORDER BY `tabSales Order`.name DESC LIMIT 50', {company:doc.company, cond:cond});
return repl('SELECT DISTINCT `tabSales Order`.name FROM `tabSales Order`, `tabSales Order Item`, `tabItem` WHERE `tabSales Order`.company = "%(company)s" AND `tabSales Order`.docstatus = 1 AND `tabSales Order Item`.parent = `tabSales Order`.name AND `tabSales Order Item`.item_code = `tabItem`.name AND `tabItem`.is_service_item = "Yes" AND %(cond)s `tabSales Order`.name LIKE "%s" ORDER BY `tabSales Order`.name DESC LIMIT 50', {company:doc.company, cond:cond}); return repl('SELECT DISTINCT `tabSales Order`.name FROM `tabSales Order`, `tabSales Order Item`, `tabItem` WHERE `tabSales Order`.company = "%(company)s" AND `tabSales Order`.docstatus = 1 AND `tabSales Order Item`.parent = `tabSales Order`.name AND `tabSales Order Item`.item_code = `tabItem`.name AND `tabItem`.is_service_item = "Yes" AND %(cond)s `tabSales Order`.name LIKE "%s" ORDER BY `tabSales Order`.name DESC LIMIT 50', {company:doc.company, cond:cond});
} }
@ -123,8 +101,16 @@ cur_frm.fields_dict['customer_issue_no'].get_query = function(doc) {
return repl('SELECT `tabCustomer Issue`.name FROM `tabCustomer Issue` WHERE `tabCustomer Issue`.company = "%(company)s" AND %(cond)s `tabCustomer Issue`.docstatus = 1 AND (`tabCustomer Issue`.status = "Open" OR `tabCustomer Issue`.status = "Work In Progress") AND `tabCustomer Issue`.name LIKE "%s" ORDER BY `tabCustomer Issue`.name DESC LIMIT 50', {company:doc.company, cond:cond}); return repl('SELECT `tabCustomer Issue`.name FROM `tabCustomer Issue` WHERE `tabCustomer Issue`.company = "%(company)s" AND %(cond)s `tabCustomer Issue`.docstatus = 1 AND (`tabCustomer Issue`.status = "Open" OR `tabCustomer Issue`.status = "Work In Progress") AND `tabCustomer Issue`.name LIKE "%s" ORDER BY `tabCustomer Issue`.name DESC LIMIT 50', {company:doc.company, cond:cond});
} }
cur_frm.fields_dict['maintenance_schedule'].get_query = function(doc) {
doc = locals[this.doctype][this.docname];
var cond = '';
if(doc.customer) {
cond = '`tabMaintenance Schedule`.customer = "'+doc.customer+'" AND';
}
return repl('SELECT `tabMaintenance Schedule`.name FROM `tabMaintenance Schedule` WHERE `tabMaintenance Schedule`.company = "%(company)s" AND %(cond)s `tabMaintenance Schedule`.docstatus = 1 AND `tabMaintenance Schedule`.name LIKE "%s" ORDER BY `tabMaintenance Schedule`.name DESC LIMIT 50', {company:doc.company, cond:cond});
}
//get query select Territory //get query select Territory
//=======================================================================================================================
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) { 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'; 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

@ -8,11 +8,11 @@
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Please edit this list and import only required elements # Please edit this list and import only required elements
import webnotes import webnotes
@ -35,130 +35,129 @@ convert_to_lists = webnotes.conn.convert_to_lists
from utilities.transaction_base import TransactionBase from utilities.transaction_base import TransactionBase
class DocType(TransactionBase): class DocType(TransactionBase):
def __init__(self, doc, doclist=[]): def __init__(self, doc, doclist=[]):
self.doc = doc self.doc = doc
self.doclist = doclist self.doclist = doclist
#get item details #get item details
#------------------ #------------------
def get_item_details(self, item_code): def get_item_details(self, item_code):
item = sql("select item_name,description from `tabItem` where name = '%s'" %(item_code), as_dict=1) item = sql("select item_name,description from `tabItem` where name = '%s'" %(item_code), as_dict=1)
ret = { ret = {
'item_name' : item and item[0]['item_name'] or '', 'item_name' : item and item[0]['item_name'] or '',
'description' : item and item[0]['description'] or '' 'description' : item and item[0]['description'] or ''
} }
return ret return ret
# fetch details of resp Sales order or customer issue # fetch details of resp Sales order or customer issue
#----------------------------------------------------------- #-----------------------------------------------------------
def fetch_items(self): def fetch_items(self):
if self.doc.sales_order_no and self.doc.customer_issue_no: if self.doc.sales_order_no and self.doc.customer_issue_no :
msgprint("You can not fetch details of both, Sales Order and Customer Issue, in same Maintenance Visit") msgprint("You can not fetch details of both, Sales Order and Customer Issue, in same Maintenance Visit")
raise Exception raise Exception
self.doc.clear_table(self.doclist, 'maintenance_visit_details') self.doc.clear_table(self.doclist, 'maintenance_visit_details')
if self.doc.sales_order_no: if self.doc.sales_order_no:
self.doclist = get_obj('DocType Mapper', 'Sales Order-Maintenance Visit').dt_map('Sales Order', 'Maintenance Visit', self.doc.sales_order_no, self.doc, self.doclist, "[['Sales Order', 'Maintenance Visit'],['Sales Order Item', 'Maintenance Visit Purpose']]") self.doclist = get_obj('DocType Mapper', 'Sales Order-Maintenance Visit').dt_map('Sales Order', \
'Maintenance Visit', self.doc.sales_order_no, self.doc, self.doclist, "[['Sales Order', 'Maintenance Visit'],\
['Sales Order Item', 'Maintenance Visit Purpose']]")
elif self.doc.customer_issue_no:
self.doclist = get_obj('DocType Mapper', 'Customer Issue-Maintenance Visit').dt_map('Customer Issue', \
'Maintenance Visit', self.doc.customer_issue_no, self.doc, self.doclist, "[['Customer Issue', 'Maintenance Visit'],\
['Customer Issue', 'Maintenance Visit Purpose']]")
elif self.doc.maintenance_schedule:
self.doclist = get_obj('DocType Mapper', 'Maintenance Schedule-Maintenance Visit').dt_map('Maintenance Schedule',\
'Maintenance Visit', self.doc.maintenance_schedule, self.doc, self.doclist, "[['Maintenance Schedule', \
'Maintenance Visit'], ['Maintenance Schedule Item', 'Maintenance Visit Purpose']]")
elif self.doc.customer_issue_no: #validate reference value using doctype mapper
self.doclist = get_obj('DocType Mapper', 'Customer Issue-Maintenance Visit').dt_map('Customer Issue', 'Maintenance Visit', self.doc.customer_issue_no, self.doc, self.doclist, "[['Customer Issue', 'Maintenance Visit'],['Customer Issue', 'Maintenance Visit Purpose']]") #-----------------------------------------------------
def validate_reference_value(self, check_for):
if check_for == 'Sales Order':
get_obj('DocType Mapper', 'Sales Order-Maintenance Visit', with_children = 1).validate_reference_value(self, self.doc.name)
elif check_for == 'Customer Issue':
get_obj('DocType Mapper', 'Customer Issue-Maintenance Visit', with_children = 1).validate_reference_value(self, self.doc.name)
#validate reference value using doctype mapper #check if serial no exist in system
#----------------------------------------------------- #--------------------------------------
def validate_reference_value(self, check_for): def validate_serial_no(self):
if check_for == 'Sales Order': for d in getlist(self.doclist, 'maintenance_visit_details'):
get_obj('DocType Mapper', 'Sales Order-Maintenance Visit', with_children = 1).validate_reference_value(self, self.doc.name) if d.serial_no and not sql("select name from `tabSerial No` where name = '%s' and docstatus != 2" % d.serial_no):
elif check_for == 'Customer Issue': msgprint("Serial No: "+ d.serial_no + " not exists in the system")
get_obj('DocType Mapper', 'Customer Issue-Maintenance Visit', with_children = 1).validate_reference_value(self, self.doc.name) raise Exception
#check if serial no exist in system
#--------------------------------------
def validate_serial_no(self):
for d in getlist(self.doclist, 'maintenance_visit_details'):
if d.serial_no and not sql("select name from `tabSerial No` where name = '%s' and docstatus != 2" % d.serial_no):
msgprint("Serial No: "+ d.serial_no + " not exists in the system")
raise Exception
#elif not d.serial_no and d.item_code:
# ser = sql("select has_serial_no from tabItem where name = '%s'" % d.item_code)
# ser = ser and ser[0][0] or 'No'
# if ser == 'Yes':
# msgprint("Serial No is mandatory for item: " + d.item_code)
# raise Exception
def validate(self): def validate(self):
if not getlist(self.doclist, 'maintenance_visit_details'): if not getlist(self.doclist, 'maintenance_visit_details'):
msgprint("Please enter maintenance details") msgprint("Please enter maintenance details")
raise Exception raise Exception
for d in getlist(self.doclist, 'maintenance_visit_details'): check_for = ''
if d.prevdoc_doctype == 'Sales Order': for d in getlist(self.doclist, 'maintenance_visit_details'):
check_for = 'Sales Order' if d.prevdoc_doctype == 'Sales Order':
elif d.prevdoc_doctype == 'Customer Issue': check_for = 'Sales Order'
check_for = 'Customer Issue' elif d.prevdoc_doctype == 'Customer Issue':
else: check_for = 'Customer Issue'
msgprint("Maintenance Visit must be created either against Sales Order or against Customer Issue")
raise Exception
if check_for: if check_for:
self.validate_reference_value(check_for) self.validate_reference_value(check_for)
self.validate_serial_no() self.validate_serial_no()
def update_customer_issue(self, flag): def update_customer_issue(self, flag):
for d in getlist(self.doclist, 'maintenance_visit_details'): for d in getlist(self.doclist, 'maintenance_visit_details'):
if d.prevdoc_docname and d.prevdoc_doctype == 'Customer Issue' : if d.prevdoc_docname and d.prevdoc_doctype == 'Customer Issue' :
if flag==1: if flag==1:
mntc_date = self.doc.mntc_date mntc_date = self.doc.mntc_date
service_person = d.service_person service_person = d.service_person
work_done = d.work_done work_done = d.work_done
if self.doc.completion_status == 'Fully Completed': if self.doc.completion_status == 'Fully Completed':
status = 'Closed' status = 'Closed'
elif self.doc.completion_status == 'Partially Completed': elif self.doc.completion_status == 'Partially Completed':
status = 'Work In Progress' status = 'Work In Progress'
else: else:
nm = sql("select t1.name, t1.mntc_date, t2.service_person, t2.work_done from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.completion_status = 'Partially Completed' and t2.prevdoc_docname = %s and t1.name!=%s and t1.docstatus = 1 order by t1.name desc limit 1", (d.prevdoc_docname, self.doc.name)) nm = sql("select t1.name, t1.mntc_date, t2.service_person, t2.work_done from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.completion_status = 'Partially Completed' and t2.prevdoc_docname = %s and t1.name!=%s and t1.docstatus = 1 order by t1.name desc limit 1", (d.prevdoc_docname, self.doc.name))
if nm: if nm:
status = 'Work In Progress' status = 'Work In Progress'
mntc_date = nm and nm[0][1] or '' mntc_date = nm and nm[0][1] or ''
service_person = nm and nm[0][2] or '' service_person = nm and nm[0][2] or ''
work_done = nm and nm[0][3] or '' work_done = nm and nm[0][3] or ''
else: else:
status = 'Open' status = 'Open'
mntc_date = '' mntc_date = ''
service_person = '' service_person = ''
work_done = '' work_done = ''
sql("update `tabCustomer Issue` set resolution_date=%s, resolved_by=%s, resolution_details=%s, status=%s where name =%s",(mntc_date,service_person,work_done,status,d.prevdoc_docname)) sql("update `tabCustomer Issue` set resolution_date=%s, resolved_by=%s, resolution_details=%s, status=%s where name =%s",(mntc_date,service_person,work_done,status,d.prevdoc_docname))
# check if last maintenance visit against same sales order/ customer issue
#-----------------------------------------------------------------------------------
def check_if_last_visit(self):
for d in getlist(self.doclist, 'maintenance_visit_details'):
if d.prevdoc_docname:
check_for_docname = d.prevdoc_docname
check_for_doctype = d.prevdoc_doctype
if check_for_docname: def check_if_last_visit(self):
check = sql("select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.name!=%s and t2.prevdoc_docname=%s and t1.docstatus = 1 and (t1.mntc_date > %s or (t1.mntc_date = %s and t1.mntc_time > %s))", (self.doc.name, check_for_docname, self.doc.mntc_date, self.doc.mntc_date, self.doc.mntc_time)) """check if last maintenance visit against same sales order/ customer issue"""
for d in getlist(self.doclist, 'maintenance_visit_details'):
if d.prevdoc_docname:
check_for_docname = d.prevdoc_docname
check_for_doctype = d.prevdoc_doctype
if check: if check_for_docname:
check_lst = [x[0] for x in check] check = sql("select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.name!=%s and t2.prevdoc_docname=%s and t1.docstatus = 1 and (t1.mntc_date > %s or (t1.mntc_date = %s and t1.mntc_time > %s))", (self.doc.name, check_for_docname, self.doc.mntc_date, self.doc.mntc_date, self.doc.mntc_time))
check_lst =','.join(check_lst)
msgprint("To cancel this, you need to cancel Maintenance Visit(s) "+cstr(check_lst)+" created after this maintenance visit against same "+check_for_doctype)
raise Exception
else:
self.update_customer_issue(0)
def on_submit(self): if check:
self.update_customer_issue(1) check_lst = [x[0] for x in check]
set(self.doc, 'status', 'Submitted') check_lst =','.join(check_lst)
msgprint("To cancel this, you need to cancel Maintenance Visit(s) "+cstr(check_lst)+" created after this maintenance visit against same "+check_for_doctype)
raise Exception
else:
self.update_customer_issue(0)
def on_cancel(self): def on_submit(self):
self.check_if_last_visit() self.update_customer_issue(1)
set(self.doc, 'status', 'Cancelled') set(self.doc, 'status', 'Submitted')
def on_update(self): def on_cancel(self):
pass self.check_if_last_visit()
set(self.doc, 'status', 'Cancelled')
def on_update(self):
pass

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2012-03-27 14:36:42', 'creation': '2012-06-11 12:10:15',
'docstatus': 0, 'docstatus': 0,
'modified': '2012-03-27 14:45:49', 'modified': '2012-06-27 12:50:00',
'modified_by': u'Administrator', 'modified_by': u'Administrator',
'owner': u'ashwini@webnotestech.com' 'owner': u'ashwini@webnotestech.com'
}, },
@ -26,7 +26,7 @@
'show_in_menu': 0, 'show_in_menu': 0,
'subject': u'To %(customer_name)s on %(mntc_date)s', 'subject': u'To %(customer_name)s on %(mntc_date)s',
'tag_fields': u'completion_status,maintenance_type', 'tag_fields': u'completion_status,maintenance_type',
'version': 95 'version': 1
}, },
# These values are common for all DocField # These values are common for all DocField
@ -144,38 +144,17 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'reqd': 1, 'reqd': 1,
'search_index': 1, 'search_index': 0,
'trigger': u'Client' 'trigger': u'Client'
}, },
# DocField
{
'doctype': u'DocField',
'fieldname': u'customer_address',
'fieldtype': u'Link',
'label': u'Customer Address',
'options': u'Address',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'contact_person',
'fieldtype': u'Link',
'label': u'Contact Person',
'options': u'Contact',
'permlevel': 0,
'print_hide': 1
},
# DocField # DocField
{ {
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'customer_name', 'fieldname': u'customer_name',
'fieldtype': u'Data', 'fieldtype': u'Data',
'label': u'Name', 'hidden': 1,
'label': u'Customer Name',
'permlevel': 1 'permlevel': 1
}, },
@ -184,6 +163,7 @@
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'address_display', 'fieldname': u'address_display',
'fieldtype': u'Small Text', 'fieldtype': u'Small Text',
'hidden': 1,
'label': u'Address', 'label': u'Address',
'permlevel': 1 'permlevel': 1
}, },
@ -193,6 +173,7 @@
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'contact_display', 'fieldname': u'contact_display',
'fieldtype': u'Small Text', 'fieldtype': u'Small Text',
'hidden': 1,
'label': u'Contact', 'label': u'Contact',
'permlevel': 1 'permlevel': 1
}, },
@ -202,6 +183,7 @@
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'contact_mobile', 'fieldname': u'contact_mobile',
'fieldtype': u'Data', 'fieldtype': u'Data',
'hidden': 1,
'label': u'Mobile No', 'label': u'Mobile No',
'permlevel': 1 'permlevel': 1
}, },
@ -211,42 +193,11 @@
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'contact_email', 'fieldname': u'contact_email',
'fieldtype': u'Data', 'fieldtype': u'Data',
'hidden': 1,
'label': u'Contact Email', 'label': u'Contact Email',
'permlevel': 1 'permlevel': 1
}, },
# DocField
{
'doctype': u'DocField',
'fieldname': u'company',
'fieldtype': u'Select',
'in_filter': 1,
'label': u'Company',
'oldfieldname': u'company',
'oldfieldtype': u'Select',
'options': u'link:Company',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'fiscal_year',
'fieldtype': u'Select',
'in_filter': 1,
'label': u'Fiscal Year',
'oldfieldname': u'fiscal_year',
'oldfieldtype': u'Select',
'options': u'link:Fiscal Year',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'search_index': 0
},
# DocField # DocField
{ {
'doctype': u'DocField', 'doctype': u'DocField',
@ -283,72 +234,6 @@
'permlevel': 0 'permlevel': 0
}, },
# DocField
{
'colour': u'White:FFF',
'default': u'Draft',
'doctype': u'DocField',
'fieldname': u'status',
'fieldtype': u'Data',
'label': u'Status',
'no_copy': 1,
'oldfieldname': u'status',
'oldfieldtype': u'Data',
'options': u'\nDraft\nCancelled\nSubmitted',
'permlevel': 1,
'reqd': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'amended_from',
'fieldtype': u'Data',
'label': u'Amended From',
'no_copy': 1,
'oldfieldname': u'amended_from',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'width': u'150px'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'amendment_date',
'fieldtype': u'Date',
'label': u'Amendment Date',
'no_copy': 1,
'oldfieldname': u'amendment_date',
'oldfieldtype': u'Date',
'permlevel': 0,
'print_hide': 1,
'width': u'100px'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'territory',
'fieldtype': u'Link',
'label': u'Territory',
'options': u'Territory',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'customer_group',
'fieldtype': u'Link',
'label': u'Customer Group',
'options': u'Customer Group',
'permlevel': 0,
'print_hide': 1
},
# DocField # DocField
{ {
'doctype': u'DocField', 'doctype': u'DocField',
@ -432,6 +317,17 @@
'trigger': u'Client' 'trigger': u'Client'
}, },
# DocField
{
'doctype': u'DocField',
'fieldname': u'maintenance_schedule',
'fieldtype': u'Link',
'in_filter': 1,
'label': u'Maintenance Schedule',
'options': u'Maintenance Schedule',
'permlevel': 0
},
# DocField # DocField
{ {
'doctype': u'DocField', 'doctype': u'DocField',
@ -470,9 +366,9 @@
# DocField # DocField
{ {
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'feedback', 'fieldname': u'more_info',
'fieldtype': u'Section Break', 'fieldtype': u'Section Break',
'label': u'Feedback', 'label': u'More Info',
'oldfieldtype': u'Section Break', 'oldfieldtype': u'Section Break',
'permlevel': 0 'permlevel': 0
}, },
@ -486,5 +382,150 @@
'oldfieldname': u'customer_feedback', 'oldfieldname': u'customer_feedback',
'oldfieldtype': u'Small Text', 'oldfieldtype': u'Small Text',
'permlevel': 0 'permlevel': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'col_break3',
'fieldtype': u'Column Break',
'permlevel': 0
},
# DocField
{
'colour': u'White:FFF',
'default': u'Draft',
'doctype': u'DocField',
'fieldname': u'status',
'fieldtype': u'Data',
'label': u'Status',
'no_copy': 1,
'oldfieldname': u'status',
'oldfieldtype': u'Data',
'options': u'\nDraft\nCancelled\nSubmitted',
'permlevel': 1,
'reqd': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'amended_from',
'fieldtype': u'Data',
'label': u'Amended From',
'no_copy': 1,
'oldfieldname': u'amended_from',
'oldfieldtype': u'Data',
'permlevel': 1,
'print_hide': 1,
'width': u'150px'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'amendment_date',
'fieldtype': u'Date',
'label': u'Amendment Date',
'no_copy': 1,
'oldfieldname': u'amendment_date',
'oldfieldtype': u'Date',
'permlevel': 0,
'print_hide': 1,
'width': u'100px'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'company',
'fieldtype': u'Select',
'in_filter': 1,
'label': u'Company',
'oldfieldname': u'company',
'oldfieldtype': u'Select',
'options': u'link:Company',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'fiscal_year',
'fieldtype': u'Select',
'in_filter': 1,
'label': u'Fiscal Year',
'oldfieldname': u'fiscal_year',
'oldfieldtype': u'Select',
'options': u'link:Fiscal Year',
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'contact_info_section',
'fieldtype': u'Section Break',
'label': u'Contact Info',
'permlevel': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'customer_address',
'fieldtype': u'Link',
'label': u'Customer Address',
'options': u'Address',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'contact_person',
'fieldtype': u'Link',
'label': u'Contact Person',
'options': u'Contact',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'col_break4',
'fieldtype': u'Column Break',
'permlevel': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'territory',
'fieldtype': u'Link',
'label': u'Territory',
'options': u'Territory',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'customer_group',
'fieldtype': u'Link',
'label': u'Customer Group',
'options': u'Customer Group',
'permlevel': 0,
'print_hide': 1
} }
] ]