Merge branch 'stable' of github.com:webnotes/erpnext into stable

This commit is contained in:
Brahma K 2011-07-25 14:47:01 +05:30
commit 5f983c3063
9 changed files with 46 additions and 11 deletions

View File

@ -143,7 +143,10 @@ MemberList.prototype.make_list = function() {
var c1 = repl(' AND (first_name LIKE "%(txt)s" OR last_name LIKE "%(txt)s" OR name LIKE "%(txt)s")', {txt:'%' + me.search_inp.value + '%'});
}
this.query = repl("SELECT distinct ifnull(name,''), ifnull(concat_ws(' ', first_name, last_name),''), ifnull(messanger_status,''), ifnull(gender,''), ifnull(file_list,''), 0, enabled from tabProfile where docstatus != 2 AND name not in ('Guest','Administrator') %(cond)s ORDER BY name asc",{cond:c1});
this.query = repl("SELECT distinct ifnull(name,''), ifnull(concat_ws(' ', first_name, last_name),''), \
ifnull(messanger_status,''), ifnull(gender,''), ifnull(file_list,''), 0, enabled, last_login \
from tabProfile where docstatus != 2 AND name not in ('Guest','Administrator') %(cond)s \
ORDER BY name asc",{cond:c1});
}
this.lst.make(this.lst_area);
this.lst.show_cell= function(cell, ri, ci, d) {

Binary file not shown.

View File

@ -1,7 +1,7 @@
# REMEMBER to update this
# ========================
last_patch = 325
last_patch = 326
#-------------------------------------------
@ -1294,3 +1294,7 @@ def execute(patch_no):
elif patch_no == 325:
sql("update `tabDocField` set fieldtype = 'Data' where parent = 'Salary Slip' and fieldname = 'total_days_in_month'")
reload_doc('hr', 'doctype', 'salary_slip')
elif patch_no == 326:
# load the new billing page
if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')):
reload_doc('server_tools','page','billing')

View File

@ -2,6 +2,32 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(doc.abbr && !doc.__islocal) set_field_permlevel('abbr',1);
}
cur_frm.cscript.has_special_chars = function(t) {
var iChars = "!@#$%^*+=-[]\\\';,/{}|\":<>?";
for (var i = 0; i < t.length; i++) {
if (iChars.indexOf(t.charAt(i)) != -1) {
return true;
}
}
return false;
}
cur_frm.cscript.company_name = function(doc){
if(doc.company_name && cur_frm.cscript.has_special_chars(doc.company_name)){
msgprint("<font color=red>Special Characters <b>! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ?</b> are not allowed for</font>\nCompany Name <b>" + doc.company_name +"</b>")
doc.company_name = '';
refresh_field('company_name');
}
}
cur_frm.cscript.abbr = function(doc){
if(doc.abbr && cur_frm.cscript.has_special_chars(doc.abbr)){
msgprint("<font color=red>Special Characters <b>! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ?</b> are not allowed for</font>\nAbbr <b>" + doc.abbr +"</b>")
doc.abbr = '';
refresh_field('abbr');
}
}
cur_frm.fields_dict.default_bank_account.get_query = function(doc) {
return 'SELECT `tabAccount`.name, `tabAccount`.debit_or_credit, `tabAccount`.group_or_ledger FROM `tabAccount` WHERE `tabAccount`.company = "'+doc.name+'" AND `tabAccount`.group_or_ledger = "Ledger" AND `tabAccount`.docstatus != 2 AND `tabAccount`.account_type = "Bank or Cash" AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';
}

View File

@ -13,7 +13,6 @@ sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
in_transaction = webnotes.conn.in_transaction
convert_to_lists = webnotes.conn.convert_to_lists
# -----------------------------------------------------------------------------------------
@ -37,9 +36,11 @@ class DocType:
#-----------------------
def set_account_details(self, args):
args = eval(args)
#webnotes.logger.error("args in set_account_details of setup_control: " + str(args))
self.set_cp_defaults(args['company'], args['industry'], args['time_zone'], args['country'], args['account_name'])
self.create_profile(args['user'], args['first_name'], args['last_name'])
from server_tools.gateway_utils import update_client_control
update_client_control(args['total_users'])
@ -182,7 +183,7 @@ class DocType:
Validates if setup has been performed after database allocation
"""
from server_tools.gateway_utils import update_client_control, get_total_users
from server_tools.gateway_utils import get_total_users
args = eval(args)
#webnotes.logger.error("args in set_account_details of setup_control: " + str(args))

View File

@ -33,7 +33,7 @@ def update_account_details():
webnotes.conn.set_global('days_to_expiry', webnotes.form_dict.get('days_to_expiry'))
if webnotes.form_dict.get('first_name'):
from server_tools.server_tools.gateway_utils import update_user_details
from server_tools.gateway_utils import update_user_details
update_user_details()
#
@ -43,6 +43,7 @@ def on_login_post_session(login_manager):
# login from
if webnotes.form_dict.get('login_from'):
webnotes.session['data']['login_from'] = webnotes.form.getvalue('login_from')
webnotes.session_obj.update()
update_account_details()
@ -51,7 +52,7 @@ def on_login_post_session(login_manager):
#
def on_logout(login_manager):
if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')):
from server_tools.server_tools.gateway_utils import logout_sso
from server_tools.gateway_utils import logout_sso
logout_sso()
#

View File

@ -2,7 +2,7 @@ body {
background-color: #e2e2e2;
}
div.layout_wrapper {
.layout_wrapper {
padding: 13px;
margin: 7px;
-moz-box-shadow: 1px 1px 6px #AAA;

View File

@ -46,11 +46,11 @@ function startup_setup() {
// for logout and payment
var callback = function(r,rt) {
if(r.message){
login_file = r.message;
login_file = 'http://' + r.message;
}
else {
login_file = 'https://www.erpnext.com';
login_file = 'http://www.erpnext.com';
}
// setup toolbar
pscript.startup_setup_toolbar();

View File

@ -58,7 +58,7 @@ class DocType:
def connect_gateway(self):
"login to gateway"
from webnotes.utils.webservice import FrameworkServer
fw = FrameworkServer('www.erpnext.com','/','__system@webnotestech.com','password',https=1)
fw = FrameworkServer('www.erpnext.com', '/', '__system@webnotestech.com', 'password', https=1)
return fw
def get_sender_name(self):