merging from master and usability fixes to setup

This commit is contained in:
Rushabh Mehta 2011-09-14 13:25:10 +05:30
parent 5f50617121
commit 1e11cb486d
16 changed files with 133 additions and 74 deletions

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:34',
'docstatus': 0,
'modified': '2011-09-13 13:23:44',
'modified': '2011-09-14 12:36:24',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@ -125,6 +125,33 @@
'to_field': 'incentives'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'eval: flt(obj.qty) - flt(obj.billed_qty)',
'map': 'Yes',
'match_id': 1,
'to_field': 'qty'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.basic_rate)',
'map': 'Yes',
'match_id': 1,
'to_field': 'amount'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.export_rate)',
'map': 'Yes',
'match_id': 1,
'to_field': 'export_amount'
},
# Table Mapper Detail
{
'doctype': 'Table Mapper Detail',

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:35',
'docstatus': 0,
'modified': '2011-09-07 12:10:30',
'modified': '2011-09-14 12:36:24',
'modified_by': 'Administrator',
'owner': 'Administrator'
},

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:35',
'docstatus': 0,
'modified': '2011-09-07 12:09:55',
'modified': '2011-09-14 12:36:24',
'modified_by': 'Administrator',
'owner': 'Administrator'
},

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:36',
'docstatus': 0,
'modified': '2011-09-13 13:23:04',
'modified': '2011-09-14 12:36:25',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@ -136,6 +136,33 @@
'to_field': 'incentives'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'eval: flt(obj.qty) - flt(obj.billed_qty)',
'map': 'Yes',
'match_id': 1,
'to_field': 'qty'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.basic_rate)',
'map': 'Yes',
'match_id': 1,
'to_field': 'amount'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'eval: (flt(obj.qty) - flt(obj.billed_qty)) * flt(obj.export_rate)',
'map': 'Yes',
'match_id': 1,
'to_field': 'export_amount'
},
# Table Mapper Detail
{
'doctype': 'Table Mapper Detail',

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2011-05-05 15:58:13',
'creation': '2011-05-20 10:07:55',
'docstatus': 0,
'modified': '2011-05-05 16:20:10',
'modified': '2011-09-14 12:36:25',
'modified_by': 'Administrator',
'owner': 'Administrator'
},

View File

@ -121,24 +121,6 @@ class DocType:
def get_dt_help(self,dt):
return sql("select description from tabDocType where name=%s",dt)[0][0] or ''
# ----------------------------------------------------------------------------------------
def welcome_done(self):
if cint(get_defaults().get('welcome_done')):
return 'Yes'
else:
return 'No'
def set_welcome_done(self):
set_default('welcome_done', '1')
# Check Complete Registration
# ----------------------
def registration_complete(self):
if cint(get_defaults().get('registration_complete')):
return 'Yes'
else:
return 'No'
# get dashboard counts
# --------------------
@ -235,29 +217,6 @@ class DocType:
# -------------------------------------------------------------------------------------------------------
def get_status_details(self, arg=''):
# no of users online
count = sql("select count(distinct user) from tabSessions t2 where user not in ('Guest','Administrator') and TIMESTAMPDIFF(HOUR,t2.lastupdate,NOW()) <= 1")
# unread messages
unread = sql("select count(t1.name) from `tabMail` t1, `tabMail Participant Details` t2 where t2.participant_name = '%s' and t2.parent = t1.name and (t2.read_status = 'No' or t2.read_status is NULL) and (t2.delete_status = 'No' or t2.delete_status is NULL) and t1.last_updated_by != t2.participant_name" % arg)
# system messages
msg_id = webnotes.conn.get_global('system_message_id')
msg = ''
if msg_id and msg_id != webnotes.conn.get_global('system_message_id', session['user']):
msg = webnotes.conn.get_global('system_message')
return {
'user_count': count and cint(count[0][0]) or 0,
'unread': unread and cint(unread[0][0]) or 0,
'system_message':msg,
'registration_complete': self.registration_complete()
}
# -------------------------------------------------------------------------------------------------------
def dismiss_message(self, arg=''):
msg_id = webnotes.conn.get_global('system_message_id')
webnotes.conn.set_global('system_message_id', msg_id, session['user'])

View File

@ -610,7 +610,7 @@ pscript.home_make_status = function() {
// complete registration
if(in_list(user_roles,'System Manager')) {
pscript.complete_registration(r.registration_complete);
pscript.complete_registration(r.message.registration_complete);
}
// setup wizard
@ -630,17 +630,24 @@ pscript.complete_registration = function(is_complete) {
d.no_cancel(); // Hide close image
$dh(page_body.wntoolbar.wrapper);
}
$($a(d.body,'div','', {margin:'8px', color:'#888'})).html('<b>Company Name : </b>'+locals['Control Panel']['Control Panel'].company_name);
d.make_body(
[
['Data','Company Abbreviation'],
['Select','Fiscal Year Start Date'],
['Select','Default Currency'],
['Button','Save'],
d.make_body([
['Data','Company Name','Example: Your Company LLC'],
['Data','Company Abbreviation', 'Example: YC (all your acconts will have this as a suffix)'],
['Select','Fiscal Year Start Date'],
['Select','Default Currency'],
['Button','Save'],
]);
//d.widgets['Save'].disabled = true; // disable Save button
// if company name is set, set the input value
// and disable it
if(locals['Control Panel']['Control Panel'].company_name) {
d.widgets['Company Name'].value = locals['Control Panel']['Control Panel'].company_name;
d.widgets['Company Name'].disabled = 1;
}
//d.widgets['Save'].disabled = true; // disable Save button
pscript.make_dialog_field(d);
// submit details
@ -652,7 +659,7 @@ pscript.complete_registration = function(is_complete) {
if(flag)
{
var args = [
locals['Control Panel']['Control Panel'].company_name,
d.widgets['Company Name'].value,
d.widgets['Company Abbreviation'].value,
d.widgets['Fiscal Year Start Date'].value,
d.widgets['Default Currency'].value

View File

@ -24,7 +24,7 @@ def get_unread_messages():
# Get toolbar items
#
def get_status_details(arg=None):
from webnotes.utils import cint, date_diff, nowdate
from webnotes.utils import cint, date_diff, nowdate, get_defaults
online = get_online_users()
@ -35,7 +35,8 @@ def get_status_details(arg=None):
'online_users': online or [],
'is_trial': webnotes.conn.get_global('is_trial'),
'days_to_expiry': (webnotes.conn.get_global('days_to_expiry') or '0'),
'setup_status': get_setup_status()
'setup_status': get_setup_status(),
'registration_complete': cint(get_defaults('registration_complete')) and 'Yes' or 'No'
}
return ret
@ -53,7 +54,7 @@ def get_setup_status():
header = webnotes.conn.get_value('Control Panel', None, 'client_name') or ''
if header.startswith('<div style="padding:4px; font-size:20px;">'\
+webnotes.conn.get_value('Control Panel', None, 'company_name')):
+(webnotes.conn.get_value('Control Panel', None, 'company_name') or '')):
return False
elif 'Banner Comes Here' in header:

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:34',
'docstatus': 0,
'modified': '2011-09-07 12:12:30',
'modified': '2011-09-14 12:36:24',
'modified_by': 'Administrator',
'owner': 'Administrator'
},

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:34',
'docstatus': 0,
'modified': '2011-09-07 12:11:39',
'modified': '2011-09-14 12:36:24',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@ -63,6 +63,20 @@
'to_field': 'customer_name'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'contact_no',
'to_field': 'phone_1'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'fax',
'to_field': 'fax_1'
},
# Table Mapper Detail
{
'doctype': 'Table Mapper Detail'

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:34',
'docstatus': 0,
'modified': '2011-09-07 12:11:00',
'modified': '2011-09-14 12:36:24',
'modified_by': 'Administrator',
'owner': 'Administrator'
},

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:35',
'docstatus': 0,
'modified': '2011-09-07 12:08:48',
'modified': '2011-09-14 12:36:24',
'modified_by': 'Administrator',
'owner': 'Administrator'
},

View File

@ -52,8 +52,7 @@ class DocType:
self.currency = currency
# Fiscal Year
master_dict = {'Fiscal Year':{'year':curr_fiscal_year,
'year_start_date':fy_start_date}}
master_dict = {'Fiscal Year':{'year':curr_fiscal_year, 'year_start_date':fy_start_date}}
self.create_records(master_dict)
# Company
@ -85,6 +84,8 @@ class DocType:
# Set Registration Complete
set_default('registration_complete','1')
webnotes.msgprint("Great! Your company has now been created")
import webnotes.utils
return webnotes.utils.get_defaults()

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2010-12-15 08:39:22',
'creation': '2010-12-14 17:56:41',
'docstatus': 0,
'modified': '2011-09-07 12:08:19',
'modified': '2011-09-14 12:36:24',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@ -107,6 +107,15 @@
'to_field': 'naming_series'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'customer_address',
'map': 'Yes',
'match_id': 0,
'to_field': 'delivery_address'
},
# Table Mapper Detail
{
'doctype': 'Table Mapper Detail',

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:35',
'docstatus': 0,
'modified': '2011-09-13 13:23:26',
'modified': '2011-09-14 12:36:25',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@ -221,6 +221,15 @@
'to_field': 'incentives'
},
# Field Mapper Detail
{
'doctype': 'Field Mapper Detail',
'from_field': 'allocated_amount',
'map': 'Yes',
'match_id': 0,
'to_field': 'customer_mobile_no'
},
# Table Mapper Detail
{
'doctype': 'Table Mapper Detail',

File diff suppressed because one or more lines are too long