rename dt first cut

This commit is contained in:
Anand Doshi
2012-03-30 12:29:06 +05:30
parent 37fb9c8f27
commit fedfd89e4a
509 changed files with 2108 additions and 2088 deletions

View File

@@ -102,7 +102,7 @@ class DocType(TransactionBase):
if based_on == 'Grand Total': auth_value = total
elif based_on == 'Customerwise Discount':
if doc_obj:
if doc_obj.doc.doctype == 'Receivable Voucher': customer = doc_obj.doc.customer
if doc_obj.doc.doctype == 'Sales Invoice': customer = doc_obj.doc.customer
else: customer = doc_obj.doc.customer_name
add_cond = " and master_name = '"+make_esc("'")(cstr(customer))+"'"
if based_on == 'Itemwise Discount':
@@ -116,8 +116,8 @@ class DocType(TransactionBase):
# Check Approving Authority for transactions other than expense voucher and Appraisal
# -------------------------
def validate_approving_authority(self, doctype_name,company, total, doc_obj = ''):
if doctype_name == 'Payable Voucher': doctype_name = 'Purchase Invoice'
elif doctype_name == 'Receivable Voucher': doctype_name = 'Sales Invoice'
if doctype_name == 'Purchase Invoice': doctype_name = 'Purchase Invoice'
elif doctype_name == 'Sales Invoice': doctype_name = 'Sales Invoice'
av_dis = 0
if doc_obj:
ref_rate, basic_rate = 0, 0
@@ -192,7 +192,7 @@ class DocType(TransactionBase):
rule ={}
if doc_obj:
if doctype_name == 'Expense Voucher':
if doctype_name == 'Expense Claim':
rule = self.get_value_based_rule(doctype_name,doc_obj.doc.employee,doc_obj.doc.total_claimed_amount, doc_obj.doc.company)
elif doctype_name == 'Appraisal':
rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and company = %s and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee, doc_obj.doc.company),as_dict=1)

View File

@@ -32,7 +32,7 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){
if(doc.based_on == 'Not Applicable') hide_field('value');
else unhide_field('value');
if(doc.transaction == 'Expense Voucher' || doc.transaction == 'Appraisal'){
if(doc.transaction == 'Expense Claim' || doc.transaction == 'Appraisal'){
hide_field(['master_name','system_role', 'system_user']);
unhide_field(['to_emp','to_designation']);
if(doc.transaction == 'Appraisal') hide_field('value');
@@ -63,7 +63,7 @@ cur_frm.cscript.based_on = function(doc){
}
cur_frm.cscript.transaction = function(doc,cdt,cdn){
if(doc.transaction == 'Expense Voucher' || doc.transaction == 'Appraisal'){
if(doc.transaction == 'Expense Claim' || doc.transaction == 'Appraisal'){
doc.master_name = doc.system_role = doc.system_user = '';
refresh_many(['master_name','system_role', 'system_user']);
hide_field(['master_name','system_role', 'system_user']);
@@ -80,7 +80,7 @@ cur_frm.cscript.transaction = function(doc,cdt,cdn){
hide_field(['to_emp','to_designation']);
}
if(doc.transaction == 'Expense Voucher') doc.based_on = 'Total Claimed Amount';
if(doc.transaction == 'Expense Claim') doc.based_on = 'Total Claimed Amount';
if(doc.transaction == 'Appraisal') doc.based_on == 'Not Applicable';
}

View File

@@ -69,7 +69,7 @@ class DocType:
# Validate Rule
# --------------
def validate_rule(self):
if not self.doc.transaction == 'Expense Voucher' and not self.doc.transaction == 'Appraisal':
if not self.doc.transaction == 'Expense Claim' and not self.doc.transaction == 'Appraisal':
if not self.doc.approving_role and not self.doc.approving_user:
msgprint("Please enter Approving Role or Approving User")
raise Exception
@@ -95,8 +95,8 @@ class DocType:
if self.doc.transaction == 'Appraisal' and self.doc.based_on != 'Not Applicable':
msgprint("Based on is 'Not Applicable' while setting authorization rule for 'Appraisal'")
raise Exception
if self.doc.transaction == 'Expense Voucher' and self.doc.based_on != 'Total Claimed Amount':
msgprint("Authorization rule should be based on 'Total Calimed Amount' while setting authorization rule for 'Expense Voucher'")
if self.doc.transaction == 'Expense Claim' and self.doc.based_on != 'Total Claimed Amount':
msgprint("Authorization rule should be based on 'Total Calimed Amount' while setting authorization rule for 'Expense Claim'")
raise Exception

View File

@@ -88,7 +88,7 @@
'label': u'Transaction',
'oldfieldname': u'transaction',
'oldfieldtype': u'Select',
'options': u'\nDelivery Note\nPurchase Invoice\nPurchase Order\nPurchase Receipt\nQuotation\nSales Invoice\nSales Order\nStock Entry\nExpense Voucher\nAppraisal',
'options': u'\nDelivery Note\nPurchase Invoice\nPurchase Order\nPurchase Receipt\nQuotation\nSales Invoice\nSales Order\nStock Entry\nExpense Claim\nAppraisal',
'reqd': 1
},

View File

@@ -241,14 +241,14 @@ class DocType:
#update value as blank for tabDefaultValue defkey=company
sql("update `tabDefaultValue` set defvalue = '' where defkey='company' and defvalue = %s", self.doc.name)
#update value as blank for tabSingles Manage Account
sql("update `tabSingles` set value = '' where doctype='Manage Account' and field = 'default_company' and value = %s", self.doc.name)
#update value as blank for tabSingles Global Defaults
sql("update `tabSingles` set value = '' where doctype='Global Defaults' and field = 'default_company' and value = %s", self.doc.name)
# on rename
# ---------
def on_rename(self,newdn,olddn):
sql("update `tabCompany` set company_name = '%s' where name = '%s'" %(newdn,olddn))
sql("update `tabSingles` set value = %s where doctype='Manage Account' and field = 'default_company' and value = %s", (newdn, olddn))
sql("update `tabSingles` set value = %s where doctype='Global Defaults' and field = 'default_company' and value = %s", (newdn, olddn))
if get_defaults('company') == olddn:
set_default('company', newdn)

View File

@@ -99,7 +99,7 @@ class DocType:
'new_enquiries': self.generate_new_type_query({
'type': 'new_enquiries',
'doctype': 'Enquiry'
'doctype': 'Opportunity'
}),
'new_quotations': self.generate_new_type_query({
@@ -110,7 +110,7 @@ class DocType:
'new_sales_orders': self.generate_new_type_query({
'type': 'new_sales_orders',
'doctype': 'Receivable Voucher',
'doctype': 'Sales Invoice',
'sum_col': 'grand_total'
}),

View File

@@ -97,7 +97,7 @@
# DocField
{
'colour': u'White:FFF',
'description': u'To track brand name in the following documents<br>\nDelivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No',
'description': u'To track brand name in the following documents<br>\nDelivery Note, Enuiry, Purchase Request, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Sales Invoice, Sales BOM, Sales Order, Serial No',
'doctype': u'DocField',
'fieldname': u'fs_brands',
'fieldtype': u'Check',
@@ -179,7 +179,7 @@
# DocField
{
'colour': u'White:FFF',
'description': u'Field available in Delivery Note, Quotation, Receivable Voucher, Sales Order',
'description': u'Field available in Delivery Note, Quotation, Sales Invoice, Sales Order',
'doctype': u'DocField',
'fieldname': u'fs_discounts',
'fieldtype': u'Check',
@@ -208,7 +208,7 @@
# DocField
{
'description': u'Available in \nBill Of Materials, Delivery Note, Payable Voucher, Production Order, Purchase Order, Purchase Receipt, Receivable Voucher, Sales Order, Stock Entry, Timesheet',
'description': u'Available in \nBOM, Delivery Note, Purchase Invoice, Production Order, Purchase Order, Purchase Receipt, Sales Invoice, Sales Order, Stock Entry, Timesheet',
'doctype': u'DocField',
'fieldname': u'fs_projects',
'fieldtype': u'Check',

View File

@@ -1,4 +1,4 @@
# DocType, Manage Account
# DocType, Global Defaults
[
# These values are common in all dictionaries
@@ -35,7 +35,7 @@
{
'doctype': u'DocField',
'name': '__common__',
'parent': u'Manage Account',
'parent': u'Global Defaults',
'parentfield': u'fields',
'parenttype': u'DocType',
'permlevel': 0
@@ -45,16 +45,16 @@
{
'doctype': u'DocPerm',
'name': '__common__',
'parent': u'Manage Account',
'parent': u'Global Defaults',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1
},
# DocType, Manage Account
# DocType, Global Defaults
{
'doctype': 'DocType',
'name': u'Manage Account'
'name': u'Global Defaults'
},
# DocPerm
@@ -273,7 +273,7 @@
'doctype': u'DocField',
'fieldname': u'auto_indent',
'fieldtype': u'Check',
'label': u'Raise Indent when stock reaches re-order level'
'label': u'Raise Purchase Request when stock reaches re-order level'
},
# DocField

View File

@@ -99,7 +99,7 @@ class DocType:
"""
Get default print format from doclayer
"""
doclayer = get_obj('DocLayer', 'DocLayer')
doclayer = get_obj('Customize Form', 'Customize Form')
doclayer.doc.doc_type = args.get('doctype')
doclayer.get()
if doclayer.doc.default_print_format:

View File

@@ -91,7 +91,7 @@
'fieldname': u'enquiry',
'fieldtype': u'Check',
'hidden': 1,
'label': u'Enquiry',
'label': u'Opportunity',
'print_hide': 1
},
@@ -166,7 +166,7 @@
'doctype': u'DocField',
'fieldname': u'expense_voucher',
'fieldtype': u'Check',
'label': u'Expense Voucher'
'label': u'Expense Claim'
},
# DocField
@@ -291,7 +291,7 @@
'fieldname': u'expense_voucher_approved_message',
'fieldtype': u'Text',
'hidden': 1,
'label': u'Expense Voucher Approved Message',
'label': u'Expense Claim Approved Message',
'print_hide': 1
},
@@ -301,7 +301,7 @@
'fieldname': u'expense_voucher_rejected_message',
'fieldtype': u'Text',
'hidden': 1,
'label': u'Expense Voucher Rejected Message',
'label': u'Expense Claim Rejected Message',
'print_hide': 1
}
]

View File

@@ -154,7 +154,7 @@ class DocType:
def update_permissions(self,args=''):
args = eval(args)
di = args['perm_dict']
doctype_keys = di.keys() # ['Enquiry','Competitor','Zone','State']
doctype_keys = di.keys() # ['Opportunity','Competitor','Zone','State']
for parent in doctype_keys:
for permlevel in di[parent].keys():
for role in di[parent][permlevel].keys():

View File

@@ -62,12 +62,12 @@ class DocType:
if sql("select name from tabItem where name=%s", line[0]):
if self.is_currency_valid(line[2]):
# if price exists
ref_ret_detail = sql("select name from `tabRef Rate Detail` where parent=%s and price_list_name=%s and ref_currency=%s", \
ref_ret_detail = sql("select name from `tabItem Price` where parent=%s and price_list_name=%s and ref_currency=%s", \
(line[0], self.doc.name, line[2]))
if ref_ret_detail:
sql("update `tabRef Rate Detail` set ref_rate=%s where name=%s", (line[1], ref_ret_detail[0][0]))
sql("update `tabItem Price` set ref_rate=%s where name=%s", (line[1], ref_ret_detail[0][0]))
else:
d = Document('Ref Rate Detail')
d = Document('Item Price')
d.parent = line[0]
d.parentfield = 'ref_rate_details'
d.parenttype = 'Item'
@@ -87,8 +87,8 @@ class DocType:
# clear prices
def clear_prices(self):
cnt = sql("select count(*) from `tabRef Rate Detail` where price_list_name = %s", self.doc.name)
sql("delete from `tabRef Rate Detail` where price_list_name = %s", self.doc.name)
cnt = sql("select count(*) from `tabItem Price` where price_list_name = %s", self.doc.name)
sql("delete from `tabItem Price` where price_list_name = %s", self.doc.name)
msgprint("%s prices cleared" % cnt[0][0])
# Update CSV data

View File

@@ -1,4 +1,4 @@
# DocType, Order Lost Reason
# DocType, Quotation Lost Reason
[
# These values are common in all dictionaries
@@ -29,7 +29,7 @@
{
'doctype': u'DocField',
'name': '__common__',
'parent': u'Order Lost Reason',
'parent': u'Quotation Lost Reason',
'parentfield': u'fields',
'parenttype': u'DocType'
},
@@ -40,7 +40,7 @@
'create': 1,
'doctype': u'DocPerm',
'name': '__common__',
'parent': u'Order Lost Reason',
'parent': u'Quotation Lost Reason',
'parentfield': u'permissions',
'parenttype': u'DocType',
'permlevel': 0,
@@ -48,10 +48,10 @@
'write': 1
},
# DocType, Order Lost Reason
# DocType, Quotation Lost Reason
{
'doctype': 'DocType',
'name': u'Order Lost Reason'
'name': u'Quotation Lost Reason'
},
# DocPerm
@@ -84,7 +84,7 @@
'doctype': u'DocField',
'fieldname': u'order_lost_reason',
'fieldtype': u'Data',
'label': u'Order Lost Reason',
'label': u'Quotation Lost Reason',
'oldfieldname': u'order_lost_reason',
'oldfieldtype': u'Data',
'permlevel': 0,

View File

@@ -82,7 +82,7 @@ class DocType:
#validation for trash of default record
if not type == 'Sales Person':
field = 'default_'+type.lower().replace(' ','_')
chk = sql("select value from `tabSingles` where doctype = 'Manage Account' and field = '%s' and value = '%s'"%(field,name))
chk = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = '%s' and value = '%s'"%(field,name))
if chk:
msgprint("'%s' record is set as a default %s in Global Defaults. Please change default %s then try to trash '%s' record."%(name,type.lower(), type.lower(), name))
raise Exception

View File

@@ -138,12 +138,12 @@ cur_frm.cscript.make_si_list = function(parent,doc){
lst.colwidths = ['5%','25%','20%','25%','25%'];
lst.colnames = ['Sr.','Id','Invoice Date','Total Commission','Grand Total'];
lst.coltypes = ['Data','Link','Data','Data','Currency','Currency'];
lst.coloptions = ['','Receivable Voucher','','','',''];
lst.coloptions = ['','Sales Invoice','','','',''];
cur_frm.cscript.set_list_opts(lst);
var q = repl("select name,posting_date, total_commission,grand_total from `tabReceivable Voucher` where sales_partner='%(sp)s'", {'sp':doc.name});
var q_max = repl("select count(name) from `tabReceivable Voucher` where sales_partner='%(cust)s'", {'sp':doc.name});
var q = repl("select name,posting_date, total_commission,grand_total from `tabSales Invoice` where sales_partner='%(sp)s'", {'sp':doc.name});
var q_max = repl("select count(name) from `tabSales Invoice` where sales_partner='%(cust)s'", {'sp':doc.name});
cur_frm.cscript.run_list(lst,parent,q,q_max,doc,'Sales Invoice','Receivable Voucher');
cur_frm.cscript.run_list(lst,parent,q,q_max,doc,'Sales Invoice','Sales Invoice');
}

View File

@@ -64,7 +64,7 @@ cur_frm.pformat.other_charges= function(doc){
}
}
var cl = getchildren('RV Tax Detail',doc.name,'other_charges');
var cl = getchildren('Sales Taxes and Charges',doc.name,'other_charges');
// outer table
var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 60%"></td><td>';

View File

@@ -44,7 +44,7 @@ class DocType:
get_obj('Sales Common').get_rate(arg, self)
def update_other_default_charges(self):
sql("update `tabOther Charges` set is_default = 0 where ifnull(is_default,0) = 1 and name != '%s' and company = '%s'" % (self.doc.name, self.doc.company))
sql("update `tabSales Taxes and Charges Master` set is_default = 0 where ifnull(is_default,0) = 1 and name != '%s' and company = '%s'" % (self.doc.name, self.doc.company))
def on_update(self):
self.update_other_default_charges()

View File

@@ -1,4 +1,4 @@
# DocType, Other Charges
# DocType, Sales Taxes and Charges Master
[
# These values are common in all dictionaries
@@ -31,7 +31,7 @@
{
'doctype': u'DocField',
'name': '__common__',
'parent': u'Other Charges',
'parent': u'Sales Taxes and Charges Master',
'parentfield': u'fields',
'parenttype': u'DocType'
},
@@ -40,16 +40,16 @@
{
'doctype': u'DocPerm',
'name': '__common__',
'parent': u'Other Charges',
'parent': u'Sales Taxes and Charges Master',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1
},
# DocType, Other Charges
# DocType, Sales Taxes and Charges Master
{
'doctype': 'DocType',
'name': u'Other Charges'
'name': u'Sales Taxes and Charges Master'
},
# DocPerm
@@ -186,10 +186,10 @@
'doctype': u'DocField',
'fieldname': u'other_charges',
'fieldtype': u'Table',
'label': u'Other Charges',
'label': u'Sales Taxes and Charges Master',
'oldfieldname': u'other_charges',
'oldfieldtype': u'Table',
'options': u'RV Tax Detail',
'options': u'Sales Taxes and Charges',
'permlevel': 0
}
]

View File

@@ -30,7 +30,7 @@ class DocType:
#Default Naming Series
#---------------------------------------------------
def naming_series(self):
ns = [['TDS Payment', 'TDSP'], ['Payable Voucher', 'BILL'], ['Journal Voucher', 'JV'], ['Receivable Voucher', 'INV'], ['Lead', 'Lead'], ['Indent', 'IDT'], ['Enquiry', 'Enquiry'], ['Purchase Order', 'PO'], ['Quotation', 'QTN'], ['Purchase Receipt', 'GRN'], ['Stock Entry', 'STE'], ['Sales Order', 'SO'], ['Delivery Note', 'DN'], ['Employee', 'EMP/']]
ns = [['TDS Payment', 'TDSP'], ['Purchase Invoice', 'BILL'], ['Journal Voucher', 'JV'], ['Sales Invoice', 'INV'], ['Lead', 'Lead'], ['Purchase Request', 'IDT'], ['Opportunity', 'Opportunity'], ['Purchase Order', 'PO'], ['Quotation', 'QTN'], ['Purchase Receipt', 'GRN'], ['Stock Entry', 'STE'], ['Sales Order', 'SO'], ['Delivery Note', 'DN'], ['Employee', 'EMP/']]
for r in ns:
rec = Document('Naming Series')
rec.select_doc_for_series = r[0]
@@ -131,25 +131,25 @@ class DocType:
def create_feed_and_todo(self):
"""update activty feed and create todo for creation of item, customer, vendor"""
import home
home.make_feed('Comment', 'ToDo Item', '', webnotes.session['user'],
home.make_feed('Comment', 'ToDo', '', webnotes.session['user'],
'<i>"' + 'Setup Complete. Please check your <a href="#!todo">\
To Do List</a>' + '"</i>', '#6B24B3')
d = Document('ToDo Item')
d = Document('ToDo')
d.description = 'Create your first Customer'
d.priority = 'High'
d.date = nowdate()
d.reference_type = 'Customer'
d.save(1)
d = Document('ToDo Item')
d = Document('ToDo')
d.description = 'Create your first Item'
d.priority = 'High'
d.date = nowdate()
d.reference_type = 'Item'
d.save(1)
d = Document('ToDo Item')
d = Document('ToDo')
d.description = 'Create your first Supplier'
d.priority = 'High'
d.date = nowdate()
@@ -195,7 +195,7 @@ class DocType:
# Set System Defaults
# --------------------
def set_defaults(self, def_args):
ma_obj = get_obj('Manage Account','Manage Account')
ma_obj = get_obj('Global Defaults','Global Defaults')
for d in def_args.keys():
ma_obj.doc.fields[d] = def_args[d]
ma_obj.doc.save()

View File

@@ -1,4 +1,4 @@
# DocType, Static Parameter Detail
# DocType, SMS Parameter
[
# These values are common in all dictionaries
@@ -27,7 +27,7 @@
'doctype': u'DocField',
'fieldtype': u'Data',
'name': '__common__',
'parent': u'Static Parameter Detail',
'parent': u'SMS Parameter',
'parentfield': u'fields',
'parenttype': u'DocType',
'permlevel': 0,
@@ -35,10 +35,10 @@
'width': u'150px'
},
# DocType, Static Parameter Detail
# DocType, SMS Parameter
{
'doctype': 'DocType',
'name': u'Static Parameter Detail'
'name': u'SMS Parameter'
},
# DocField

View File

@@ -127,7 +127,7 @@
'doctype': u'DocField',
'fieldname': u'static_parameter_details',
'fieldtype': u'Table',
'label': u'Static Parameter Details',
'options': u'Static Parameter Detail'
'label': u'SMS Parameters',
'options': u'SMS Parameter'
}
]

View File

@@ -1,4 +1,4 @@
# DocType, Term
# DocType, Terms and Conditions
[
# These values are common in all dictionaries
@@ -31,7 +31,7 @@
{
'doctype': u'DocField',
'name': '__common__',
'parent': u'Term',
'parent': u'Terms and Conditions',
'parentfield': u'fields',
'parenttype': u'DocType'
},
@@ -40,16 +40,16 @@
{
'doctype': u'DocPerm',
'name': '__common__',
'parent': u'Term',
'parent': u'Terms and Conditions',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1
},
# DocType, Term
# DocType, Terms and Conditions
{
'doctype': 'DocType',
'name': u'Term'
'name': u'Terms and Conditions'
},
# DocPerm

View File

@@ -36,7 +36,7 @@ pscript.onload_Webforms = function(){
lead_dv.innerHTML = '&lt;iframe src ="'+url+'?ac_name='+acc_id+'&embed=Lead" width ="400" height="800" frameborder="0"&gt;&lt;/iframe&gt;';
cust_issue_dv.innerHTML = '&lt;iframe src ="'+url+'?ac_name='+acc_id+'&embed=Customer Issue" width ="400" height="500" frameborder="0"&gt;&lt;/iframe&gt;';
job_dv.innerHTML = '&lt;iframe src ="'+url+'?ac_name='+acc_id+'&embed=Job Application" width ="400" height="800" frameborder="0""&gt;&lt;/iframe&gt;';
ticket_dv.innerHTML = '&lt;iframe src ="'+url+'?ac_name='+acc_id+'&embed=Support Ticket" width ="400" height="800" frameborder="0""&gt;&lt;/iframe&gt;';
ticket_dv.innerHTML = '&lt;iframe src ="'+url+'?ac_name='+acc_id+'&embed=Support Task" width ="400" height="800" frameborder="0""&gt;&lt;/iframe&gt;';
}
});
}