merged from webnotes/erpnext

This commit is contained in:
Rushabh Mehta
2011-08-29 10:47:58 +05:30
145 changed files with 5862 additions and 4363 deletions

View File

@@ -13,7 +13,7 @@ class DocType:
for r in res:
ret[cstr(r[0])]=r[1] and cstr(r[1]) or ''
return str(ret)
return ret
def set_cp_value(self, key):
"""

View File

@@ -28,4 +28,4 @@ class DocType:
#
def set_html_from_image(self):
file_name = self.doc.file_list.split(',')[0]
self.doc.header_html = '<div><img src="cgi-bin/getfile.cgi?name=' + file_name + '"/></div>'
self.doc.header_html = '<div><img style="max-height: 120px; max-width: 600px" src="index.cgi?cmd=get_file&fname=' + file_name + '"/></div>'

View File

@@ -281,4 +281,4 @@ class DocType:
elif cond_hold =='Yes':
all_cond_hold ='Yes'
return all_cond_hold
return all_cond_hold

View File

@@ -32,7 +32,7 @@
</tbody>
</table>
</form>
<div style="background-color: #FFE; padding: 10px; margin: 10px;">
<div style="background-color: #FFE; padding: 13px; margin: 17px;">
<h3>Data Import Guide</h3>
<ol>
<li>Get the template of the DocType for which you want to import in CSV (Comma seperated values) format.</li>

View File

@@ -1,45 +1,55 @@
pscript['onload_Import Data'] = function() {
//alert(profile.can_get_report);
//alert(profile.can_get_report);
callback = function(r,rt) {
var h = new PageHeader('di_header','Import Data','Tool to download template and upload data');
var sel = $i('import_template');
if(r.message){
add_sel_options(sel, r.message);
sel.onchange=function(){
$i('child_tab_lst').innerHTML ='';
if(sel.value != 'Select Master...'){
$c_obj('Import Data Control','get_child_lst',sel.value,
function(r,rt){
var me = this;
$y($i('child_tab_lst'),{backgroundColor:'#EEEEEE'})
var desc = $a($i('child_tab_lst'), 'div', '', {padding:'8px'});
desc.innerHTML = "<h4>Please click on following link(s) to download template.</h4>";
callback = function(r,rt) {
var h = new PageHeader('di_header','Import Data','Tool to download template and upload data');
var sel = $i('import_template');
if(r.message){
add_sel_options(sel, r.message);
// please collapse here when editing :)
sel.onchange=function(){
$i('child_tab_lst').innerHTML ='';
if(sel.value != 'Select Master...'){
$c_obj('Import Data Control','get_child_lst',sel.value,
function(r,rt){
var me = this;
$y($i('child_tab_lst'),{backgroundColor:'#EEEEEE', margin: '17px 17px', padding: '13px'})
var desc = $a($i('child_tab_lst'), 'div', '', {padding:'4px'});
desc.innerHTML = "<b>Download template(s) for importing "+sel_val(sel)+"</b>";
var parent = $a($i('child_tab_lst'), 'div');
var tab = make_table(parent,r.message.length,1,'100%',[],{padding:'8px',fontSize:'15px',borderCollapse: 'collapse'});
for(var i=0;i<r.message.length;i++){
var dt= $a($td(tab,i,0), 'span', 'link_type');
dt.innerHTML = r.message[i];
dt.nm = r.message[i];
dt.onclick = function(){
var ovr = $('input[name="overwrite"]:checked').length;
window.location = outUrl + '?cmd=get_template&dt=' + this.nm + (ovr ? '&overwrite=1' : '');
}
}
}
);
}
}
}
}
$c_obj('Import Data Control','get_master_lst','',callback);
var parent = $a($i('child_tab_lst'), 'div');
var tab = make_table(parent,r.message.length,1,'100%',[],{padding:'3px',borderCollapse: 'collapse'});
for(var i=0;i<r.message.length;i++){
var dt= $a($td(tab,i,0), 'span', 'link_type');
dt.innerHTML = r.message[i];
dt.nm = r.message[i];
dt.onclick = function(){
var ovr = $('input[name="overwrite"]:checked').length;
window.location = outUrl + '?cmd=get_template&dt=' + this.nm + (ovr ? '&overwrite=1' : '');
}
}
}
);
}
}
}
// set the default (if given in url)
if(window.location.hash) {
var to_set = window.location.hash.split('/').slice(-1)[0];
if(in_list(r.message, to_set)) {
sel.value = to_set;
sel.onchange();
}
}
}
$c_obj('Import Data Control','get_master_lst','',callback);
}