added whitelist check

This commit is contained in:
Rushabh Mehta
2012-02-13 16:50:52 +05:30
parent ff0946bbda
commit f17ce7bc67
20 changed files with 38 additions and 160 deletions

View File

@@ -30,17 +30,10 @@ class DocType:
from webnotes.utils import fmt_money, flt
bal = webnotes.conn.sql("select `tabAccount Balance`.balance,`tabAccount`.debit_or_credit from `tabAccount`,`tabAccount Balance` where `tabAccount Balance`.account=%s and `tabAccount Balance`.period=%s and `tabAccount Balance`.account=`tabAccount`.name ",(arg,self.doc.current_fiscal_year))
if bal:
return fmt_money(flt(bal[0][0])) + ' ' + bal[0][1]
def validate(self):
"""validate"""
if not (self.doc.account_url and (self.doc.account_url.startswith('http://') \
or self.doc.account_url.startswith('https://'))):
webnotes.msgprint("Account URL must start with 'http://' or 'https://'", raise_exception=1)
return fmt_money(flt(bal[0][0])) + ' ' + bal[0][1]
def on_update(self):
"""update defaults"""
self.validate()
for key in keydict:
webnotes.conn.set_default(key, self.doc.fields.get(keydict[key], ''))

View File

@@ -140,7 +140,7 @@ class DocType:
for d in def_args.keys():
ma_obj.doc.fields[d] = def_args[d]
ma_obj.doc.save()
ma_obj.update_cp()
ma_obj.on_update()
# Set Control Panel Defaults

View File

@@ -1 +0,0 @@
<div id="crm_home"></div>

View File

@@ -1,32 +0,0 @@
//make tabs
pscript.onload_people = function() {
make_customer_tab($i('crm_home'));
}
function make_customer_tab(parent) {
new wn.widgets.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']
},
})
}

View File

@@ -1,26 +0,0 @@
[
{
'content': None,
'creation': '2011-03-21 12:12:32',
'docstatus': 0,
'doctype': 'Page',
'icon': None,
'idx': None,
'menu_index': None,
'modified': '2011-03-21 12:13:39',
'modified_by': 'Administrator',
'module': 'Setup',
'name': 'people',
'owner': 'Administrator',
'page_name': 'People',
'parent': None,
'parent_node': None,
'parentfield': None,
'parenttype': None,
'script': None,
'show_in_menu': None,
'standard': 'Yes',
'static_content': None,
'style': None
}
]