| ';out+=''+make_row('Net Total',fmt_money(convert_rate(doc.net_total)),1);if(cl.length){for(var i=0;i';out+='';out+='In Words | '
-out+=''+doc.in_words_export+' | '}
-out+='
| ';}
-return out;}
-cur_frm.cscript.charge_type=function(doc,cdt,cdn){var d=locals[cdt][cdn];if(d.idx==1&&(d.charge_type=='On Previous Row Amount'||d.charge_type=='On Previous Row Total')){alert("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row");d.charge_type='';}
-validated=false;refresh_field('charge_type',d.name,'other_charges');cur_frm.cscript.row_id(doc,cdt,cdn);cur_frm.cscript.rate(doc,cdt,cdn);cur_frm.cscript.tax_amount(doc,cdt,cdn);}
-cur_frm.cscript.row_id=function(doc,cdt,cdn){var d=locals[cdt][cdn];if(!d.charge_type&&d.row_id){alert("Please select Charge Type first");d.row_id='';}
-else if((d.charge_type=='Actual'||d.charge_type=='On Net Total')&&d.row_id){alert("You can Enter Row only if your Charge Type is 'On Previous Row Amount' or ' Previous Row Total'");d.row_id='';}
-else if((d.charge_type=='On Previous Row Amount'||d.charge_type=='On Previous Row Total')&&d.row_id){if(d.row_id>=d.idx){alert("You cannot Enter Row no. greater than or equal to current row no. for this Charge type");d.row_id='';}}
-validated=false;refresh_field('row_id',d.name,'other_charges');}
-cur_frm.fields_dict['other_charges'].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") AND tabAccount.company = "'+doc.company+'" AND tabAccount.name LIKE "%s"'}
-cur_frm.cscript.account_head=function(doc,cdt,cdn){var d=locals[cdt][cdn];if(!d.charge_type&&d.account_head){alert("Please select Charge Type first");validated=false;d.account_head='';}
-else if(d.account_head&&d.charge_type){arg="{'charge_type' : '"+d.charge_type+"', 'account_head' : '"+d.account_head+"'}";get_server_fields('get_rate',arg,'other_charges',doc,cdt,cdn,1);}
-refresh_field('account_head',d.name,'other_charges');}
-cur_frm.cscript.rate=function(doc,cdt,cdn){var d=locals[cdt][cdn];if(!d.charge_type&&d.rate){alert("Please select Charge Type first");d.rate='';}
-validated=false;refresh_field('rate',d.name,'other_charges');}
-cur_frm.cscript.tax_amount=function(doc,cdt,cdn){var d=locals[cdt][cdn];if(!d.charge_type&&d.tax_amount){alert("Please select Charge Type first");d.tax_amount='';}
-else if(d.charge_type&&d.tax_amount){alert("You cannot directly enter Amount and if your Charge Type is Actual enter your amount in Rate");d.tax_amount='';}
-validated=false;refresh_field('tax_amount',d.name,'other_charges');}
\ No newline at end of file
diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py
index dee01b2f6b..284e2a8a36 100644
--- a/setup/doctype/setup_control/setup_control.py
+++ b/setup/doctype/setup_control/setup_control.py
@@ -145,7 +145,7 @@ class DocType:
pr = Document('Profile')
pr.first_name = user_fname
pr.last_name = user_lname
- pr.email = user_email
+ pr.name = pr.email = user_email
pr.enabled = 1
pr.save(1)
self.add_roles(pr)
@@ -158,9 +158,9 @@ class DocType:
d.save(1)
# Add roles to Administrator profile
- pr_obj = get_obj('Profile','Administrator')
+ pr = Document('Profile','Administrator')
for r in roles_list:
- d = addchild(pr_obj.doc,'userroles', 'UserRole', 1)
+ d = addchild(pr,'userroles', 'UserRole', 1)
d.role = r
d.save(1)
diff --git a/setup/page/people/people.comp.js b/setup/page/people/people.comp.js
deleted file mode 100644
index 8938b6a73a..0000000000
--- a/setup/page/people/people.comp.js
+++ /dev/null
@@ -1,50 +0,0 @@
-
-pscript.onload_people=function(){make_customer_tab($i('crm_home'));}
-function make_customer_tab(parent){new DocColumnView('Customers',parent,['Customer Group','Customer','Contact'],{'Customer Group':{show_fields:['name'],create_fields:['name'],search_fields:['name'],next_col:'Customer'},'Customer':{show_fields:['name','customer_name'],create_fields:['name','customer_name'],search_fields:['customer_name'],filter_by:['Customer Group','customer_group'],next_col:'Contact'},'Contact':{show_fields:['name','first_name','last_name'],create_fields:['name','first_name','last_name'],search_fields:['first_name','last_name'],conditions:['is_customer=1'],filter_by:['Customer','customer']},})}
-function DocColumnView(title,parent,items,opts){this.columns={};this.items=items;this.page_head=new PageHeader(parent,title);this.make_columns(items.length,parent);for(var i=0;i1){var l=[];for(var i=1;iPlease Note: Any action will also affect other permissions with similar rules!'
-var t=make_table($a(w,'div','',{borderBottom:'1px solid #AAA'}),1,3,'90%',['40%','40%','20%'],{fontWeight:'bold',padding:'3px',fontSize:'14px'});$td(t,0,0).innerHTML='Who?';$td(t,0,1).innerHTML='Is allowed if '+details.match+' equals';var dl=r.message.dl;this.options=r.message.ol;if(!this.profiles){this.profiles=r.message.pl;}
-for(var i=0;iDeleting...';var callback=function(r,rt){$dh(me.wrapper);if(r.exc)msgprint('There were errors!')}
-$c_obj('Permission Control','delete_default',[this.details.parent,this.fieldname,this.details.defvalue].join('~~~'),callback)}
-MatchDefaultValue.prototype.save=function(){var me=this;var callback=function(r,rt){me.details=r.message;me.clear();me.render();me.pe.add_new_match_row(me.fieldname);}
-if(sel_val(this.profile_or_role)=='Profile'){var parent=sel_val(this.profile_sel);var parenttype='Profile';}
-else{var parent=sel_val(this.role_sel);var parenttype='Role';}
-if(!sel_val(this.options_sel)||!parent){msgprint("Please select all values");return;}
-$c_obj('Permission Control','add_default',[parent,parenttype,this.fieldname,sel_val(this.options_sel)].join('~~~'),callback);this.wrapper.innerHTML='Adding... ';}
-pscript.PermEngine.prototype.make_fields_dialog=function(){if(!pscript.get_field_dialog){pscript.get_field_dialog=new Dialog(750,500,'Fields');pscript.get_field_dialog.make_body([['HTML','Fields',''],['Button','OK']]);}
-else $i('perm_engine_get_fields').innerHTML='';}
-pscript.PermEngine.prototype.get_fields=function(dt,permlevel){var me=this;var callback=function(r,rt){var parent_fields_dict=r.message.parent_fields_dict;var table_fields_dict=r.message.table_fields_dict;me.make_fields_dialog();me.make_fields_table(dt,parent_fields_dict,table_fields_dict,permlevel);pscript.get_field_dialog.show();pscript.get_field_dialog.widgets['OK'].onclick=function(){pscript.get_field_dialog.hide();}}
-var args="{'dt':'"+dt+"','permlevel':"+permlevel+"}"
-$c_obj('Permission Control','get_fields',args,callback);}
-pscript.PermEngine.prototype.make_fields_table=function(dt,parent_fields_dict,table_fields_dict,permlevel){var make_grid=function(table,fields_dict){var col_labels=['Label','Fieldtype','Fieldname','Options'];for(var n=0;n'+col_labels[n]+'';$td(table,0,n).fieldname=col_labels[n].toLowerCase();}
-for(var i=0;i'+dt+' Fields at Level '+permlevel+':
';var parent_field_table=make_table('perm_engine_get_fields',keys(parent_fields_dict).length+1,4,'100%',['25%','25%','25%','25%'],{border:'1px solid #AAA',padding:'2px'});make_grid(parent_field_table,parent_fields_dict);child_tables=keys(table_fields_dict)
-if(child_tables.length>0){for(var k=0;k0){$i('perm_engine_get_fields').innerHTML+=' '+child_tables[k]+' Fields at Level '+permlevel+':
'
-var child_field_table=make_table('perm_engine_get_fields',keys(tab_fields_det).length+1,4,'100%',['25%','25%','25%','25%'],{border:'1px solid #AAA',padding:'2px'});make_grid(child_field_table,tab_fields_det);}}}}
-pscript.PermEngine.prototype.update_permissions=function(){var me=this;var out={};var add_to_out=function(doctype,permlevel,role,key,value){if(!out[doctype])out[doctype]={};if(!out[doctype][permlevel])out[doctype][permlevel]={};if(!out[doctype][permlevel][role])out[doctype][permlevel][role]={};out[doctype][permlevel][role][key]=value;}
-for(i in pscript.all_checkboxes){c=pscript.all_checkboxes[i];add_to_out(c.doctype,c.permlevel,c.role,c.perm_type,c.checked?1:0);}
-for(var i=0;ib[0];});for(var i=0;i |