Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
This commit is contained in:
commit
7ef15ce7fe
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-04-13 11:56:18',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-05-02 09:57:50',
|
||||
'modified': '2012-05-04 11:56:59',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -296,19 +296,6 @@
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'posting_time',
|
||||
'fieldtype': u'Time',
|
||||
'label': u'Posting Time',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'posting_time',
|
||||
'oldfieldtype': u'Time',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
@ -327,6 +314,18 @@
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'mode_of_payment',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Mode of Payment',
|
||||
'oldfieldname': u'mode_of_payment',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'link:Mode of Payment',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
@ -1091,6 +1090,19 @@
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'posting_time',
|
||||
'fieldtype': u'Time',
|
||||
'label': u'Posting Time',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'posting_time',
|
||||
'oldfieldtype': u'Time',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'allow_on_submit': 1,
|
||||
@ -1106,18 +1118,6 @@
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'mode_of_payment',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Mode of Payment',
|
||||
'oldfieldname': u'mode_of_payment',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'link:Mode of Payment',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
|
@ -80,14 +80,8 @@ report.get_query = function() {
|
||||
add_col = '';
|
||||
add_tables = '';
|
||||
sp_cond = '';
|
||||
if(trans == 'Sales Invoice') trans = 'Sales Invoice';
|
||||
else if(trans == 'Purchase Invoice') trans = 'Purchase Invoice';
|
||||
|
||||
trans_det = trans+' Detail'
|
||||
|
||||
if(trans == 'Sales Invoice') trans_det = 'Sales Invoice Item';
|
||||
else if(trans == 'Purchase Invoice') trans_det = 'Purchase Invoice Item';
|
||||
else if(trans == 'Purchase Order') trans_det = 'Purchase Order Item';
|
||||
trans_det = trans+' Item'
|
||||
|
||||
if(order_type != '') add_code += ' AND t1.order_type = '+order_type;
|
||||
|
||||
|
@ -39,14 +39,8 @@ project = filter_values.get('project')
|
||||
# ********************************************* SET DEFAULTS **************************************************
|
||||
# Details Table
|
||||
# --------------
|
||||
if trans == 'Sales Invoice': trans = 'Sales Invoice'
|
||||
elif trans == 'Purchase Invoice': trans = 'Purchase Invoice'
|
||||
|
||||
trans_det = trans+' Detail'
|
||||
|
||||
if trans == 'Sales Invoice': trans_det = 'Sales Invoice Item'
|
||||
elif trans == 'Purchase Invoice': trans_det = 'Purchase Invoice Item'
|
||||
elif trans == 'Purchase Order': trans_det = 'Purchase Order Item'
|
||||
trans_det = trans+' Item'
|
||||
|
||||
col_names, query_val = get_obj('Trend Analyzer Control').get_single_year_query_value(fiscal_year, period, trans, trans_det)
|
||||
query_val += 'SUM(t2.qty), SUM(t2.amount)'
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-04-03 12:49:53',
|
||||
'creation': '2012-04-23 12:46:00',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-04-03 12:49:53',
|
||||
'modified': '2012-05-04 12:49:43',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'saumil@webnotestech.com'
|
||||
},
|
||||
|
@ -0,0 +1,99 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
rendt = {
|
||||
'Receivable Voucher' : 'Sales Invoice',
|
||||
'RV Detail' : 'Sales Invoice Item',
|
||||
'RV Tax Detail' : 'Sales Taxes and Charges',
|
||||
'Payable Voucher' : 'Purchase Invoice',
|
||||
'PV Detail' : 'Purchase Invoice Item',
|
||||
'Purchase Tax Detail' : 'Purchase Taxes and Charges',
|
||||
'Indent' : 'Purchase Request',
|
||||
'Indent Detail' : 'Purchase Request Item',
|
||||
'QA Inspection Report' : 'Quality Inspection',
|
||||
'Ticket' : 'Task',
|
||||
'Manage Account' : 'Global Defaults',
|
||||
'ToDo Item' : 'ToDo',
|
||||
'Term' : 'Terms and Conditions',
|
||||
'Static Parameter Detail' : 'SMS Parameter',
|
||||
'SS Earning Detail' : 'Salary Slip Earning',
|
||||
'SS Deduction Detail' : 'Salary Slip Deduction',
|
||||
'Sales Order Detail' : 'Sales Order Item',
|
||||
'Sales BOM Detail' : 'Sales BOM Item',
|
||||
'Return Detail' : 'Sales and Purchase Return Item',
|
||||
'Ref Rate Detail' : 'Item Price',
|
||||
'Receiver Detail' : 'SMS Receiver',
|
||||
'Quotation Detail' : 'Quotation Item',
|
||||
'QA Specification Detail' : 'Quality Inspection Reading',
|
||||
'Purchase Receipt Detail' : 'Purchase Receipt Item',
|
||||
'Purchase Other Charges' : 'Purchase Taxes and Charges Master',
|
||||
'PR Raw Material Detail' : 'Purchase Receipt Item Supplied',
|
||||
'PP SO Detail' : 'Production Plan Sales Order',
|
||||
'PP Detail' : 'Production Plan Item',
|
||||
'PO Raw Material Detail' : 'Purchase Order Item Supplied',
|
||||
'PO Detail' : 'Purchase Order Item',
|
||||
'Packing Slip Detail' : 'Packing Slip Item',
|
||||
'Other Charges' : 'Sales Taxes and Charges Master',
|
||||
'Order Lost Reason' : 'Quotation Lost Reason',
|
||||
'Manage Account' : 'Global Defaults',
|
||||
'Maintenance Visit Detail' : 'Maintenance Visit Purpose',
|
||||
'Ledger Balance Export' : 'Multi Ledger Report',
|
||||
'LC PR Detail' : 'Landed Cost Purchase Receipt',
|
||||
'Landed Cost Detail' : 'Landed Cost Item',
|
||||
'KRA Template' : 'Appraisal Template',
|
||||
'KRA Sheet' : 'Appraisal Template Goal',
|
||||
'Item Specification Detail' : 'Item Quality Inspection Parameter',
|
||||
'Item Maintenance Detail' : 'Maintenance Schedule Item',
|
||||
'IR Payment Detail' : 'Payment to Invoice Matching Tool Detail',
|
||||
'Internal Reconciliation' : 'Payment to Invoice Matching Tool',
|
||||
'Installed Item Details' : 'Installation Note Item',
|
||||
'Holiday List Detail' : 'Holiday',
|
||||
'Follow up' : 'Communication Log',
|
||||
'Flat BOM Detail' : 'BOM Explosion Item',
|
||||
'Expense Voucher Detail' : 'Expense Claim Detail',
|
||||
'Expense Voucher' : 'Expense Claim',
|
||||
'Expense Type' : 'Expense Claim Type',
|
||||
'Enquiry Detail' : 'Opportunity Item',
|
||||
'Enquiry' : 'Opportunity',
|
||||
'Earning Detail' : 'Salary Structure Earning',
|
||||
'DocLayerField' : 'Customize Form Field',
|
||||
'DocLayer' : 'Customize Form',
|
||||
'Delivery Note Detail' : 'Delivery Note Item',
|
||||
'Deduction Detail' : 'Salary Structure Deduction',
|
||||
'Comment Widget Record' : 'Comment',
|
||||
'BOM Material' : 'BOM Item',
|
||||
'Bill Of Materials' : 'BOM',
|
||||
'Appraisal Detail' : 'Appraisal Goal',
|
||||
'Advance Allocation Detail' : 'Purchase Invoice Advance',
|
||||
'Advance Adjustment Detail' : 'Sales Invoice Advance',
|
||||
'Ledger Detail' : 'Multi Ledger Report Detail',
|
||||
'TA Control' : 'Trend Analyzer Control',
|
||||
'Sales and Purchase Return Wizard' : 'Sales and Purchase Return Tool',
|
||||
'Educational Qualifications Detail' : 'Employee Education',
|
||||
'Delivery Note Packing Detail' : 'Delivery Note Packing Item',
|
||||
'Experience In Company Detail' : 'Employee Internal Work History',
|
||||
'Professional Training Details' : 'Employee Training',
|
||||
'Previous Experience Detail' : 'Employee External Work History',
|
||||
}
|
||||
|
||||
for d in rendt:
|
||||
webnotes.conn.sql("""
|
||||
update
|
||||
`tabSearch Criteria`
|
||||
set
|
||||
doc_type = replace(doc_type, %s, %s),
|
||||
filters = replace(filters, %s, %s),
|
||||
columns = replace(columns, %s, %s),
|
||||
parent_doc_type = replace(parent_doc_type, %s, %s),
|
||||
add_cond = replace(add_cond, %s, %s),
|
||||
add_col = replace(add_col, %s, %s),
|
||||
add_tab = replace(add_tab, %s, %s),
|
||||
dis_filters = replace(dis_filters, %s, %s),
|
||||
group_by = replace(group_by, %s, %s),
|
||||
sort_by = replace(sort_by, %s, %s),
|
||||
report_script = replace(report_script, %s, %s),
|
||||
server_script = replace(server_script, %s, %s),
|
||||
custom_query = replace(custom_query, %s, %s)
|
||||
""", (d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d],
|
||||
d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d]))
|
||||
|
||||
|
@ -327,5 +327,10 @@ patch_list = [
|
||||
'patch_file': 'cleanup_notification_control',
|
||||
'description': 'cleanup notification control'
|
||||
},
|
||||
{
|
||||
'patch_module': 'patches.may_2012',
|
||||
'patch_file': 'renamedt_in_custom_search_criteria',
|
||||
'description': 'raname dt in custom search criteria'
|
||||
},
|
||||
|
||||
]
|
||||
|
@ -81,7 +81,12 @@ class DocType:
|
||||
|
||||
# Set
|
||||
self.set_defaults(def_args)
|
||||
self.set_cp_defaults(**args)
|
||||
|
||||
cp_args = {}
|
||||
for k in ['industry', 'country', 'timezone', 'company_name']:
|
||||
cp_args[k] = args[k]
|
||||
|
||||
self.set_cp_defaults(**cp_args)
|
||||
|
||||
self.create_feed_and_todo()
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:36:33',
|
||||
'creation': '2012-05-03 11:00:55',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:33',
|
||||
'modified': '2012-05-04 13:02:26',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'wasim@webnotestech.com'
|
||||
},
|
||||
@ -21,7 +21,7 @@
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 2
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
|
@ -24,3 +24,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.landed_cost.grid.get_field('account_head').get_query = function(doc, cdt, cdn) {
|
||||
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type = "Tax" OR tabAccount.account_type = "Chargeable" or (tabAccount.is_pl_account = "Yes" and tabAccount.debit_or_credit = "Debit")) AND tabAccount.name LIKE "%s"';
|
||||
}
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:36:34',
|
||||
'creation': '2012-05-03 11:00:55',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:34',
|
||||
'modified': '2012-05-04 13:02:35',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -19,13 +19,12 @@
|
||||
'name': '__common__',
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
'version': 2
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Data',
|
||||
'name': '__common__',
|
||||
'oldfieldtype': u'Data',
|
||||
'parent': u'Landed Cost Master Detail',
|
||||
@ -44,14 +43,17 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'account_head',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Account Head',
|
||||
'oldfieldname': u'account_head'
|
||||
'oldfieldname': u'account_head',
|
||||
'options': u'Account'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'description',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Description',
|
||||
'oldfieldname': u'description',
|
||||
'width': u'300px'
|
||||
|
@ -47,13 +47,13 @@ class DocType:
|
||||
|
||||
return content
|
||||
|
||||
def convert_into_list(self, data):
|
||||
def convert_into_list(self, data, submit = 1):
|
||||
"""Convert csv data into list"""
|
||||
count = 1
|
||||
count = 2
|
||||
for s in data:
|
||||
if s[0].strip() != 'Item Code': # remove the labels
|
||||
if count == 2: continue
|
||||
# validate
|
||||
if len(s) != 4:
|
||||
if (submit and len(s) != 4) or (not submit and len(s) != 6):
|
||||
msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1)
|
||||
self.validated = 0
|
||||
self.validate_item(s[0], count)
|
||||
@ -66,17 +66,16 @@ class DocType:
|
||||
raise Exception
|
||||
|
||||
|
||||
def get_reconciliation_data(self,submit = 0):
|
||||
def get_reconciliation_data(self,submit = 1):
|
||||
"""Read and validate csv data"""
|
||||
import csv
|
||||
data = csv.reader(self.get_csv_file_data().splitlines())
|
||||
self.convert_into_list(data)
|
||||
self.convert_into_list(data, submit)
|
||||
|
||||
|
||||
def validate_item(self, item, count):
|
||||
""" Validate item exists and non-serialized"""
|
||||
det = sql("select item_code, has_serial_no from `tabItem` \
|
||||
where name = %s", cstr(item), as_dict = 1)
|
||||
det = sql("select item_code, has_serial_no from `tabItem` where name = %s", cstr(item), as_dict = 1)
|
||||
if not det:
|
||||
msgprint("Item: " + cstr(item) + " mentioned at Row No. " + cstr(count) + "does not exist in the system")
|
||||
self.validated = 0
|
||||
@ -176,7 +175,7 @@ class DocType:
|
||||
"""Add diffs column in attached file"""
|
||||
|
||||
# add header
|
||||
out = "'Item Code', 'Warehouse', 'Qty', 'Valuation Rate', 'Qty Diff', 'Val Rate Diff'"
|
||||
out = "Item Code, Warehouse, Qty, Valuation Rate, Qty Diff, Val Rate Diff"
|
||||
|
||||
# add data
|
||||
for d in self.data:
|
||||
@ -199,5 +198,5 @@ class DocType:
|
||||
|
||||
|
||||
def on_cancel(self):
|
||||
self.validate()
|
||||
self.get_reconciliation_data(submit = 0)
|
||||
self.do_stock_reco(is_submit = -1)
|
||||
|
@ -1314,7 +1314,7 @@ LocalDB.delete_doc=function(dt,dn){var doc=get_local(dt,dn);for(var ndt in local
|
||||
delete locals[dt][dn];}
|
||||
function get_local(dt,dn){return locals[dt]?locals[dt][dn]:null;}
|
||||
LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i<list.length;i++){var d=list[i];if(!d.name)
|
||||
d.name=LocalDB.get_localname(d.doctype);LocalDB.add(d.doctype,d.name);locals[d.doctype][d.name]=d;if(d.doctype=='DocField')wn.meta.add_field(d);if(d.localname){wn.model.new_names[d.localname]=d.name;console.log(d.localname);$(document).trigger('rename',[d.doctype,d.localname,d.name]);delete locals[d.doctype][d.localname];}}}
|
||||
d.name=LocalDB.get_localname(d.doctype);LocalDB.add(d.doctype,d.name);locals[d.doctype][d.name]=d;if(d.doctype=='DocField')wn.meta.add_field(d);if(d.localname){wn.model.new_names[d.localname]=d.name;$(document).trigger('rename',[d.doctype,d.localname,d.name]);delete locals[d.doctype][d.localname];}}}
|
||||
local_name_idx={};LocalDB.get_localname=function(doctype){if(!local_name_idx[doctype])local_name_idx[doctype]=1;var n='New '+get_doctype_label(doctype)+' '+local_name_idx[doctype];local_name_idx[doctype]++;return n;}
|
||||
LocalDB.set_default_values=function(doc){var doctype=doc.doctype;var docfields=wn.meta.docfield_list[doctype];if(!docfields){return;}
|
||||
var fields_to_refresh=[];for(var fid=0;fid<docfields.length;fid++){var f=docfields[fid];if(!in_list(no_value_fields,f.fieldtype)&&doc[f.fieldname]==null){var v=LocalDB.get_default_value(f.fieldname,f.fieldtype,f['default']);if(v){doc[f.fieldname]=v;fields_to_refresh.push(f.fieldname);}}}
|
||||
@ -1686,7 +1686,7 @@ d.onshow=function(){d.done_btn_area.innerHTML='';d.done_btn=$btn(d.done_btn_area
|
||||
d.onhide=function(){if(_f.cur_grid){_f.cur_grid.refresh_row(_f.cur_grid_ridx,me.dn);}
|
||||
if(wn.container.page.frm){cur_frm=wn.container.page.frm;}
|
||||
if(me.cur_frm.cscript.hide_dialog){me.cur_frm.cscript.hide_dialog();}
|
||||
console.log(me.cur_frm.wrapper);$(me.cur_frm.page_layout.wrapper).toggle(false);}
|
||||
$(me.cur_frm.page_layout.wrapper).toggle(false);}
|
||||
this.dialog=d;}
|
||||
_f.edit_record=function(dt,dn){if(!_f.frm_dialog){_f.frm_dialog=new _f.FrmDialog();}
|
||||
var d=_f.frm_dialog;wn.model.with_doctype(dt,function(){wn.model.with_doc(dt,dn,function(dn){if(!_f.frms[dt]){_f.frms[dt]=new _f.Frm(dt,d.body);}
|
||||
@ -1712,8 +1712,7 @@ this.appframe.add_button('Amend',function(){cur_frm.amend_doc()},'icon-pencil');
|
||||
/*
|
||||
* lib/js/legacy/widgets/form/form.js
|
||||
*/
|
||||
wn.provide('_f');_f.frms={};_f.Frm=function(doctype,parent){this.docname='';this.doctype=doctype;this.display=0;var me=this;this.is_editable={};this.opendocs={};this.sections=[];this.grids=[];this.cscript={};this.pformat={};this.fetch_dict={};this.parent=parent;this.tinymce_id_list=[];this.setup_meta(doctype);var me=this;$(document).bind('rename',function(event,dt,old_name,new_name){console.log(arguments)
|
||||
if(dt==me.doctype)
|
||||
wn.provide('_f');_f.frms={};_f.Frm=function(doctype,parent){this.docname='';this.doctype=doctype;this.display=0;var me=this;this.is_editable={};this.opendocs={};this.sections=[];this.grids=[];this.cscript={};this.pformat={};this.fetch_dict={};this.parent=parent;this.tinymce_id_list=[];this.setup_meta(doctype);var me=this;$(document).bind('rename',function(event,dt,old_name,new_name){if(dt==me.doctype)
|
||||
me.rename_notify(dt,old_name,new_name)});}
|
||||
_f.Frm.prototype.check_doctype_conflict=function(docname){var me=this;if(this.doctype=='DocType'&&docname=='DocType'){msgprint('Allowing DocType, DocType. Be careful!')}else if(this.doctype=='DocType'){if(wn.views.formview[docname]){msgprint("Cannot open DocType when its instance is open")
|
||||
throw'doctype open conflict'}}else{if(wn.views.formview.DocType&&wn.views.formview.DocType.frm.opendocs[this.doctype]){msgprint("Cannot open instance when its DocType is open")
|
||||
@ -1809,7 +1808,7 @@ this.runclientscript('validate',this.doctype,this.docname);if(!validated){this.s
|
||||
var ret_fn=function(r){me.savingflag=false;if(user=='Guest'&&!r.exc){$dh(me.page_layout.wrapper);$ds(me.saved_wrapper);me.saved_wrapper.innerHTML='<div style="padding: 150px 16px; text-align: center; font-size: 14px;">'
|
||||
+(cur_frm.message_after_save?cur_frm.message_after_save:'Your information has been sent. Thank you!')
|
||||
+'</div>';return;}
|
||||
if(!me.meta.istable){me.refresh();}
|
||||
if(!me.meta.istable){me.refresh(r.docname);}
|
||||
if(call_back){call_back(r);}}
|
||||
var me=this;var ret_fn_err=function(r){var doc=locals[me.doctype][me.docname];me.savingflag=false;ret_fn(r);}
|
||||
this.savingflag=true;if(this.docname&&validated){scroll(0,0);return this.savedoc(save_action,ret_fn,ret_fn_err);}}
|
||||
@ -2009,7 +2008,7 @@ _p.def_print_style_other="\n.simpletable, .noborder { border-collapse: collapse;
|
||||
_p.go=function(html){var d=document.createElement('div')
|
||||
d.innerHTML=html
|
||||
$(d).printElement();}
|
||||
_p.preview=function(html){var w=window.open('');w.document.write(html)
|
||||
_p.preview=function(html){var w=window.open('');if(!w)return;w.document.write(html)
|
||||
w.document.close();}
|
||||
$.extend(_p,{show_dialog:function(){if(!_p.dialog){_p.make_dialog();}
|
||||
_p.dialog.show();},make_dialog:function(){var d=new Dialog(360,140,'Print Formats',[['HTML','Select'],['Check','No Letterhead'],['HTML','Buttons']]);$btn(d.widgets.Buttons,'Print',function(){_p.build(sel_val(cur_frm.print_sel),_p.go,d.widgets['No Letterhead'].checked);},{cssFloat:'right',marginBottom:'16px',marginLeft:'7px'},'green');$btn(d.widgets.Buttons,'Preview',function(){_p.build(sel_val(cur_frm.print_sel),_p.preview,d.widgets['No Letterhead'].checked);},{cssFloat:'right',marginBottom:'16px'},'');d.onshow=function(){var c=_p.dialog.widgets['Select'];if(c.cur_sel&&c.cur_sel.parentNode==c){c.removeChild(c.cur_sel);}
|
||||
|
@ -758,7 +758,7 @@ LocalDB.delete_doc=function(dt,dn){var doc=get_local(dt,dn);for(var ndt in local
|
||||
delete locals[dt][dn];}
|
||||
function get_local(dt,dn){return locals[dt]?locals[dt][dn]:null;}
|
||||
LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i<list.length;i++){var d=list[i];if(!d.name)
|
||||
d.name=LocalDB.get_localname(d.doctype);LocalDB.add(d.doctype,d.name);locals[d.doctype][d.name]=d;if(d.doctype=='DocField')wn.meta.add_field(d);if(d.localname){wn.model.new_names[d.localname]=d.name;console.log(d.localname);$(document).trigger('rename',[d.doctype,d.localname,d.name]);delete locals[d.doctype][d.localname];}}}
|
||||
d.name=LocalDB.get_localname(d.doctype);LocalDB.add(d.doctype,d.name);locals[d.doctype][d.name]=d;if(d.doctype=='DocField')wn.meta.add_field(d);if(d.localname){wn.model.new_names[d.localname]=d.name;$(document).trigger('rename',[d.doctype,d.localname,d.name]);delete locals[d.doctype][d.localname];}}}
|
||||
local_name_idx={};LocalDB.get_localname=function(doctype){if(!local_name_idx[doctype])local_name_idx[doctype]=1;var n='New '+get_doctype_label(doctype)+' '+local_name_idx[doctype];local_name_idx[doctype]++;return n;}
|
||||
LocalDB.set_default_values=function(doc){var doctype=doc.doctype;var docfields=wn.meta.docfield_list[doctype];if(!docfields){return;}
|
||||
var fields_to_refresh=[];for(var fid=0;fid<docfields.length;fid++){var f=docfields[fid];if(!in_list(no_value_fields,f.fieldtype)&&doc[f.fieldname]==null){var v=LocalDB.get_default_value(f.fieldname,f.fieldtype,f['default']);if(v){doc[f.fieldname]=v;fields_to_refresh.push(f.fieldname);}}}
|
||||
|
Loading…
Reference in New Issue
Block a user