fixed conflict in version

This commit is contained in:
Nabin Hait 2012-03-01 10:58:48 +05:30
commit bb4539e458
33 changed files with 610 additions and 283 deletions

View File

@ -9,6 +9,7 @@
"lib/js/wn/require.js",
"lib/js/wn/dom.js",
"lib/js/wn/page.js",
"lib/js/wn/misc/user.js",
"lib/js/lib/json2.js",
"lib/js/core.js"
]
@ -78,6 +79,7 @@
"lib/js/lib/jquery.min.js:concat",
"lib/js/lib/history/history.min.js:concat",
"lib/js/lib/bootstrap.min.js:concat",
"lib/js/lib/sprintf.js",
"lib/js/core.min.js:concat",
"lib/js/legacy/globals.js",
"lib/js/legacy/utils/datatype.js",
@ -121,6 +123,7 @@
"lib/js/legacy/jquery/jquery-ui.min.js:concat",
"lib/js/legacy/tiny_mce_33/jquery.tinymce.js:concat",
"lib/js/lib/bootstrap.min.js:concat",
"lib/js/lib/sprintf.js",
"lib/js/core.min.js:concat",
"lib/js/legacy/globals.js",
"lib/js/legacy/utils/datatype.js",
@ -175,9 +178,9 @@
"lib/js/legacy/app.js",
"js/app.js",
"erpnext/startup/startup.js",
"erpnext/startup/modules.js",
"erpnext/startup/toolbar.js",
"erpnext/startup/feature_setup.js"
"erpnext/startup/js/modules.js",
"erpnext/startup/js/toolbar.js",
"erpnext/startup/js/feature_setup.js"
]
}

View File

View File

@ -0,0 +1,23 @@
#activity-list .label {
display: inline-block;
width: 100px;
margin-right: 7px;
}
#activity-list .label-info {
cursor: pointer;
}
#activity-list .user-info {
float: right;
color: #777;
font-size: 10px;
}
#activity-list .date-sep {
margin-bottom: 11px;
padding: 5px 0px;
border-bottom: 1px solid #aaa;
color: #555;
font-size: 10px;
}

View File

@ -0,0 +1,6 @@
<div class="layout-wrapper">
<a class="close" onclick="window.history.back();">&times;</a>
<h1>Activity</h1>
<div id="activity-list">
</div>
</div>

View File

@ -0,0 +1,61 @@
wn.pages['activity'].onload = function(wrapper) {
var list = new wn.widgets.Listing({
method: 'home.page.activity.activity.get_feed',
parent: $('#activity-list'),
render_row: function(row, data) {
new erpnext.ActivityFeed(row, data);
}
});
list.run();
}
erpnext.last_feed_date = false;
erpnext.ActivityFeed = Class.extend({
init: function(row, data) {
this.scrub_data(data);
this.add_date_separator(row, data);
$(row).append(sprintf('<span %(onclick)s\
class="label %(add_class)s">%(feed_type)s</span>\
%(link)s %(subject)s <span class="user-info">%(by)s</span>', data));
},
scrub_data: function(data) {
data.by = wn.user_info(data.owner).fullname;
// feedtype
if(!data.feed_type) {
data.feed_type = get_doctype_label(data.doc_type);
data.add_class = "label-info";
data.onclick = repl('onclick="window.location.href=\'#!List/%(feed_type)s\';"', data)
}
// color for comment
if(data.feed_type=='Comment') {
data.add_class = "label-important";
}
if(data.feed_type=='Assignment') {
data.add_class = "label-warning";
}
// link
if(data.doc_name && data.feed_type!='Login') {
data.link = repl('<a href="#!Form/%(doc_type)s/%(doc_name)s">%(doc_name)s</a>', data)
}
},
add_date_separator: function(row, data) {
var date = dateutil.str_to_obj(data.modified);
var last = erpnext.last_feed_date;
if((last && dateutil.get_diff(last, date)>1) || (!last)) {
var pdate = dateutil.comment_when(date);
var diff = dateutil.get_diff(new Date(), date);
if(diff < 1) {
pdate = 'Today';
} else if(diff > 6) {
pdate = dateutil.global_date_format(date);
}
$(row).html(repl('<div class="date-sep">%(date)s</div>', {date: pdate}));
}
erpnext.last_feed_date = date;
}
})

View File

@ -0,0 +1,16 @@
import webnotes
@webnotes.whitelist()
def get_feed(arg=None):
"""get feed"""
return webnotes.conn.sql("""select
distinct t1.name, t1.feed_type, t1.doc_type, t1.doc_name, t1.subject, t1.owner,
t1.modified
from tabFeed t1, tabDocPerm t2
where t1.doc_type = t2.parent
and t2.role in ('%s')
and ifnull(t2.`read`,0) = 1
order by t1.modified desc
limit %s, %s""" % ("','".join(webnotes.get_roles()),
webnotes.form_dict['limit_start'], webnotes.form_dict['limit_page_length']),
as_dict=1)

View File

@ -0,0 +1,28 @@
# Page, activity
[
# These values are common in all dictionaries
{
'creation': '2012-02-29 11:59:13',
'docstatus': 0,
'modified': '2012-02-29 12:11:46',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Page
{
'doctype': 'Page',
'module': u'Home',
'name': '__common__',
'page_name': u'activity',
'standard': u'Yes',
'title': u'Activity'
},
# Page, activity
{
'doctype': 'Page',
'name': u'activity'
}
]

View File

@ -3,12 +3,12 @@ wn.provide('erpnext.desktop');
erpnext.desktop.gradient = "<style>\
.case-%(name)s {\
background: %(start)s; /* Old browsers */\
background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%, %(middle)s 44%, %(end)s 100%); /* FF3.6+ */\
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,%(start)s), color-stop(44%,%(middle)s), color-stop(100%,%(end)s)); /* Chrome,Safari4+ */\
background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Chrome10+,Safari5.1+ */\
background: -o-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Opera 12+ */\
background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* IE10+ */\
background: radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* W3C */\
background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%%, %(middle)s 44%%, %(end)s 100%%); /* FF3.6+ */\
background: -webkit-gradient(radial, center center, 0px, center center, 100%%, color-stop(0%%,%(start)s), color-stop(44%%,%(middle)s), color-stop(100%%,%(end)s)); /* Chrome,Safari4+ */\
background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* Chrome10+,Safari5.1+ */\
background: -o-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* Opera 12+ */\
background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* IE10+ */\
background: radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* W3C */\
}\
</style>"
@ -79,7 +79,7 @@ erpnext.desktop.render = function() {
for(var i in wn.boot.modules_list) {
var m = wn.boot.modules_list[i];
if(m!='Setup');
if(m!='Setup')
add_icon(m);
}

View File

@ -1,124 +0,0 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// complete my company registration
// --------------------------------
pscript.complete_registration = function(is_complete, profile) {
if(is_complete == 'No'){
var d = new Dialog(400, 200, "Setup your Account");
if(user != 'Administrator'){
d.no_cancel(); // Hide close image
$('header').toggle(false);
}
d.make_body([
['HTML', 'Your Profile Details', '<h4>Your Profile Details</h4>'],
['Data', 'First Name'],
['Data', 'Last Name'],
['HTML', 'Company Details', '<h4>Create your first company</h4>'],
['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'],
]);
// if company name is set, set the input value
// and disable it
if(wn.control_panel.company_name) {
d.widgets['Company Name'].value = wn.control_panel.company_name;
d.widgets['Company Name'].disabled = 1;
}
if(profile && profile.length>0) {
if(profile[0].first_name && profile[0].first_name!='None') {
d.widgets['First Name'].value = profile[0].first_name;
}
if(profile[0].last_name && profile[0].last_name!='None') {
d.widgets['Last Name'].value = profile[0].last_name;
}
}
//d.widgets['Save'].disabled = true; // disable Save button
pscript.make_dialog_field(d);
// submit details
d.widgets['Save'].onclick = function()
{
d.widgets['Save'].set_working();
flag = pscript.validate_fields(d);
if(flag)
{
var args = [
d.widgets['Company Name'].value,
d.widgets['Company Abbreviation'].value,
d.widgets['Fiscal Year Start Date'].value,
d.widgets['Default Currency'].value,
d.widgets['First Name'].value,
d.widgets['Last Name'].value
];
$c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
sys_defaults = r.message;
user_fullname = r.message.user_fullname;
d.hide();
$('header').toggle(true);
page_body.wntoolbar.set_user_name();
});
} else {
d.widgets['Save'].done_working();
}
}
d.show();
}
}
// make dialog fields
// ------------------
pscript.make_dialog_field = function(d)
{
// fiscal year format
fisc_format = d.widgets['Fiscal Year Start Date'];
add_sel_options(fisc_format, ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct']);
// default currency
currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR', 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR', 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY', 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'];
currency = d.widgets['Default Currency'];
add_sel_options(currency, currency_list);
}
// validate fields
// ---------------
pscript.validate_fields = function(d)
{
var lst = ['First Name', 'Company Name', 'Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency'];
var msg = 'Please enter the following fields';
var flag = 1;
for(var i=0; i<lst.length; i++)
{
if(!d.widgets[lst[i]].value || d.widgets[lst[i]].value=='None'){
flag = 0;
msg = msg + NEWLINE + lst[i];
}
}
if(!flag) alert(msg);
return flag;
}

View File

@ -26,13 +26,15 @@ MyProfile = function(wrapper) {
this.make = function() {
this.head = new PageHeader(this.wrapper, 'My Profile Settings');
this.head.add_button('Change Password', this.change_password)
this.head.add_button('Change Password', this.change_password);
this.head.add_button('Change Background', this.change_background);
this.tab = make_table($a(this.wrapper, 'div', '', {marginTop:'19px'}),
1, 2, '90%', ['50%', '50%'], {padding:'11px'})
this.img = $a($td(this.tab, 0, 0), 'img');
set_user_img(this.img, user);
$btn($a($td(this.tab, 0, 0), 'div', '', {marginTop:'11px'}), 'Change Image', this.change_image)
$btn($a($td(this.tab, 0, 0), 'div', '', {marginTop:'11px'}), 'Change Image', this.change_image);
this.make_form();
this.load_details();
@ -105,32 +107,42 @@ MyProfile = function(wrapper) {
//
this.change_image = function() {
if(!me.change_dialog) {
var d = new Dialog(400,200,'Set Your Profile Image');
d.make_body([
['HTML','wrapper']
]);
var w = d.widgets['wrapper'];
me.uploader = new Uploader(w,
{
modulename:'home.page.profile_settings.profile_settings',
method: 'set_user_image'
},
pscript.user_image_upload, 1)
me.change_dialog = d;
}
me.change_dialog.show();
var d = new wn.widgets.Dialog({
title: 'Set your Profile'
})
me.uploader = new Uploader(d.body, {
modulename:'home.page.profile_settings.profile_settings',
method: 'set_user_image'
},
pscript.user_image_upload, 1)
d.show();
pscript.open_dialog = d;
}
this.change_background = function() {
var d = new wn.widgets.Dialog({
title: 'Set Background Image'
})
me.uploader = new Uploader(d.body, {
modulename:'home.page.profile_settings.profile_settings',
method: 'set_user_background'
},
pscript.background_change, 1)
d.show();
pscript.open_dialog = d;
}
this.make();
}
pscript.background_change = function(fid) {
//erpnext.set_background_image(fid);
pscript.open_dialog.hide();
}
pscript.user_image_upload = function(fid) {
msgprint('File Uploaded');
if(fid) {
pscript.myprofile.change_dialog.hide();
pscript.open_dialog.hide();
set_user_img(pscript.myprofile.img, user, null, fid);
}
}

View File

@ -63,6 +63,31 @@ def set_user_image(fid, fname):
"""
Set uploaded image as user image
"""
from webnotes.utils.file_manager import add_file_list, remove_all
remove_all('Profile', webnotes.session['user'])
add_file_list('Profile', webnotes.session['user'], fname, fid)
from webnotes.utils.file_manager import add_file_list, remove_file
user = webnotes.session['user']
# remove old file
old_image = webnotes.conn.get_value('Profile', user, 'user_image')
if old_image:
remove_file('Profile', user, old_image)
# add new file
add_file_list('Profile', user, fname, fid)
webnotes.conn.set_value('Profile', user, 'user_image', fid)
@webnotes.whitelist()
def set_user_background(fid, fname):
"""
Set uploaded image as user image
"""
from webnotes.utils.file_manager import add_file_list, remove_file
user = webnotes.session['user']
# remove old file
old_image = webnotes.conn.get_value('Profile', user, 'background_image')
if old_image:
remove_file('Profile', user, old_image)
# add new file
add_file_list('Profile', user, fname, fid)
webnotes.conn.set_value('Profile', user, 'background_image', fid)

View File

@ -32,6 +32,10 @@ def execute():
reload_doc('utilities', 'page', 'todo')
reload_doc('utilities', 'page', 'calendar')
reload_doc('utilities', 'page', 'messages')
reload_doc('setup', 'page', 'modules_setup')
reload_doc('utilities', 'page', 'users')
reload_doc('home', 'page', 'activity')
reload_doc('core', 'doctype', 'profile')
webnotes.conn.set_value('Control Panel', 'Control Panel', 'home_page',
'desktop')

View File

@ -121,4 +121,40 @@ patch_list = [
'patch_file': 'fix_packing_slip',
'description': 'Update Mapper Delivery Note-Packing Slip'
},
{
'patch_module': 'patches.jan_mar_2012.apps',
'patch_file': 'todo_item',
'description': 'Reloads todo item'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'convert_tables_to_utf8',
'description': 'Convert tables to UTF-8'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'pending_patches',
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'pos_setting_patch',
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'reload_doctype',
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'reload_po_pr_mapper',
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'delete_pur_of_service',
'description': 'Deletes purpose of service'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'navupdate',
'description': 'New Navigation Pages'
},
]

View File

@ -14,24 +14,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Please edit this list and import only required elements
import webnotes
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
from webnotes.model.doclist import getlist, copy_doclist
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
from webnotes import session, form, is_testing, msgprint, errprint
from webnotes.utils import cint, cstr, flt, getdate, now, nowdate
from webnotes.model.doc import Document, addchild
from webnotes.model.code import get_obj
from webnotes import session, form, msgprint
set = webnotes.conn.set
sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
in_transaction = webnotes.conn.in_transaction
convert_to_lists = webnotes.conn.convert_to_lists
# -----------------------------------------------------------------------------------------
class DocType:
def __init__(self, d, dl):
@ -58,8 +48,8 @@ class DocType:
args = json.loads(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'], args.get('pwd'))
self.create_profile(args['user'], args['first_name'], args['last_name'], args.get('pwd'))
# Domain related updates
try:
from server_tools.gateway_utils import add_domain_map
@ -68,22 +58,27 @@ class DocType:
pass
# add record in domain_list of Website Settings
webnotes.conn.set_value('Website Settings', 'Website Settings', 'subdomain', args['url_name'] + ".erpnext.com")
account_url = args['url_name'] + '.erpnext.com'
webnotes.conn.set_value('Website Settings', 'Website Settings',
'subdomain', account_url)
# Account Setup
# ---------------
def setup_account(self, args):
import webnotes
company_name, comp_abbr, fy_start, currency, first_name, last_name = eval(args)
curr_fiscal_year,fy_start_date = self.get_fy_details(fy_start)
self.currency = currency
import webnotes, json
args = json.loads(args)
curr_fiscal_year, fy_start_date = self.get_fy_details(args.get('fy_start'))
args['name'] = webnotes.session.get('user')
# Update Profile
if last_name=='None': last_name = None
if not args.get('last_name') or args.get('last_name')=='None': args['last_name'] = None
webnotes.conn.sql("""\
UPDATE `tabProfile` SET first_name=%s, last_name=%s
WHERE name=%s AND docstatus<2""", (first_name, last_name, webnotes.user.name))
UPDATE `tabProfile` SET first_name=%(first_name)s,
last_name=%(last_name)s
WHERE name=%(name)s AND docstatus<2""", args)
# Fiscal Year
@ -91,15 +86,15 @@ class DocType:
self.create_records(master_dict)
# Company
master_dict = {'Company':{'company_name':company_name,
'abbr':comp_abbr,
'default_currency':currency
}}
master_dict = {'Company':{'company_name':args.get('company_name'),
'abbr':args.get('company_abbr'),
'default_currency':args.get('currency')
}}
self.create_records(master_dict)
def_args = {'current_fiscal_year':curr_fiscal_year,
'default_currency': currency,
'default_company':company_name,
'default_currency': args.get('currency'),
'default_company':args.get('company_name'),
'default_valuation_method':'FIFO',
'default_stock_uom':'Nos',
'date_format':'dd-mm-yyyy',
@ -111,21 +106,51 @@ class DocType:
'emp_created_by':'Naming Series',
'cust_master_name':'Customer Name',
'supp_master_name':'Supplier Name',
'default_currency_format': (currency=='INR') and 'Lacs' or 'Millions'
'default_currency_format': \
(args.get('currency')=='INR') and 'Lacs' or 'Millions'
}
# Set
self.set_defaults(def_args)
# Set Registration Complete
set_default('registration_complete','1')
self.create_feed_and_todo()
msgprint("Great! Your company has now been created")
webnotes.clear_cache()
msgprint("Company setup is complete")
import webnotes.utils
user_fullname = (first_name or '') + (last_name and (" " + last_name) or '')
user_fullname = (args.get('first_name') or '') + (args.get('last_name')
and (" " + args.get('last_name')) or '')
return {'sys_defaults': webnotes.utils.get_defaults(), 'user_fullname': user_fullname}
def create_feed_and_todo(self):
"""update activty feed and create todo for creation of item, customer, vendor"""
import home
home.make_feed('Comment', 'ToDo Item', '', webnotes.session['user'],
'<i>"' + 'Setup Complete. Please check your <a href="#!todo">\
To Do List</a>' + '"</i>', '#6B24B3')
d = Document('ToDo Item')
d.description = 'Create your first Customer'
d.priority = 'High'
d.date = nowdate()
d.reference_type = 'Customer'
d.save(1)
d = Document('ToDo Item')
d.description = 'Create your first Item'
d.priority = 'High'
d.date = nowdate()
d.reference_type = 'Item'
d.save(1)
d = Document('ToDo Item')
d.description = 'Create your first Supplier'
d.priority = 'High'
d.date = nowdate()
d.reference_type = 'Supplier'
d.save(1)
# Get Fiscal year Details
# ------------------------
@ -207,14 +232,6 @@ class DocType:
d = addchild(pr,'userroles', 'UserRole', 1)
d.role = r
d.save(1)
# Sync DB
# -------
def sync_db(arg=''):
import webnotes.model.db_schema
sql("delete from `tabDocType Update Register`")
webnotes.model.db_schema.sync_all()
def is_setup_okay(self, args):
@ -224,21 +241,14 @@ class DocType:
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))
args = eval(args)
cp_defaults = webnotes.conn.get_value('Control Panel', None, 'account_id')
user_profile = webnotes.conn.get_value('Profile', args['user'], 'name')
from webnotes.utils import cint
total_users = get_total_users()
#webnotes.logger.error("setup_control.is_setup_okay: " + cp_defaults + " " + user_profile + " " + str(total_users))
#webnotes.logger.error("setup_control.is_setup_okay: Passed Values:" + args['account_name'] + " " + args['user'] + " " + str(args['total_users']))
if (cp_defaults==args['account_name']) and user_profile and \
(total_users==cint(args['total_users'])):
return 'True'

View File

@ -41,6 +41,7 @@
<li>Select the saved CSV file, identify the date format if any</li>
<li>Click on "Import"</li>
</ol>
<br />
<h4>Over-writing Guide</h4>
<ol>
<li>To over-write data, click on "Do you want to over-write records?" and then download template</li>
@ -48,6 +49,30 @@
<li>Over-writing of child table data will delete all previous data of child table and re-import. so before over-writing child tables, export all data from system, modify them and then re-import</li>
<li>Over-write checkbox will be checked while importing</li>
</ol>
<br />
<h4>Do you have Non-English data?</h4>
You may need to save the file with UTF-8 encoding for data to be imported correctly.
<br /><br />
Microsoft Excel Users:<br />
There is no obvious way of saving a CSV file with UTF-8 encoding.<br />
You will need to follow these steps:
<ol>
<li>In Excel, save the file in CSV (Comma Delimited) format</li>
<li>Open this saved file in Notepad</li>
<li>Click on File -&gt; Save As</li>
<li>File Name: &lt;your filename&gt;.csv<br />
Save as type: Text Documents (*.txt)<br />
Encoding: UTF-8
</li>
<li>Click on Save</li>
</ol>
<br />
OpenOffice or LibreOffice Users:<br />
<ol>
<li>While saving as CSV, check "Edit Filter Settings".</li>
<li>You will be prompted for Encoding.</li>
<li>Make sure it is "UTF-8" and click on OK.</li>
</ol>
</div>
</td>
<td style="border: 1px solid #AAA; padding: 4px;">

View File

@ -89,6 +89,12 @@ def boot_session(bootinfo):
bootinfo['docs'] += webnotes.model.doctype.get('Event')
bootinfo['modules_list'] = webnotes.conn.get_global('modules_list')
# if no company, show a dialog box to create a new company
bootinfo['setup_complete'] = webnotes.conn.sql("""select name from
tabCompany limit 1""") and 'Yes' or 'No'
bootinfo['user_background'] = webnotes.conn.get_value("Profile", webnotes.session['user'], 'background_image') or ''
def get_letter_heads():
"""load letter heads with startup"""

View File

@ -0,0 +1,93 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// complete my company registration
// --------------------------------
erpnext.complete_setup = function() {
var currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN',
'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR',
'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF',
'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP',
'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF',
'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF',
'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD',
'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR',
'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP',
'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR',
'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY',
'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV',
'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'];
var d = new wn.widgets.Dialog({
title: "Setup",
fields: [
{fieldname:'first_name', label:'Your First Name', fieldtype:'Data', reqd: 1},
{fieldname:'last_name', label:'Your Last Name', fieldtype:'Data'},
{fieldname:'company_name', label:'Company Name', fieldtype:'Data', reqd:1,
description: 'e.g. "My Company LLC"'},
{fieldname:'company_abbr', label:'Company Abbreviation', fieldtype:'Data',
description:'e.g. "MC"',reqd:1},
{fieldname:'fy_start', label:'Financial Year Start Date', fieldtype:'Select',
description:'Your financial year begins on"', reqd:1,
options: ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct'].join('\n')},
{fieldname:'currency', label: 'Default Currency', reqd:1,
options: currency_list.join('\n'), fieldtype: 'Select'},
{fieldname:'update', label:'Setup',fieldtype:'Button'}
]
})
// prepare
if(user != 'Administrator'){
d.no_cancel(); // Hide close image
$('header').toggle(false); // hide toolbar
}
// company name already set
if(wn.control_panel.company_name) {
var inp = d.fields_dict.company_name.input;
inp.value = wn.control_panel.company_name;
inp.disabled = true;
}
// set first name, last name
if(user_fullname) {
u = user_fullname.split(' ');
if(u[0]) {
d.fields_dict.first_name.input.value = u[0];
}
if(u[1]) {
d.fields_dict.last_name.input.value = u[1];
}
}
// setup
d.fields_dict.update.input.onclick = function() {
var data = d.get_values();
if(!data) return;
$(this).set_working();
$c_obj('Setup Control','setup_account',data,function(r, rt){
sys_defaults = r.message;
user_fullname = r.message.user_fullname;
wn.boot.user_info[user].fullname = user_fullname;
d.hide();
$('header').toggle(true);
page_body.wntoolbar.set_user_name();
});
}
d.show();
}

View File

@ -73,7 +73,10 @@ erpnext.module_page.make_list = function(module, wrapper) {
args: {
module: module
},
no_refresh: true
no_refresh: true,
callback: function(r) {
erpnext.module_page.hide_links(wrapper)
}
});
wrapper.list.run();
}

View File

@ -30,7 +30,7 @@ erpnext.modules = {
'Website': 'website-home',
'HR': 'hr-home',
'Setup': 'Setup',
'Activity': 'Event Updates',
'Activity': 'activity',
'To Do': 'todo',
'Calendar': 'calendar',
'Messages': 'messages',
@ -50,6 +50,9 @@ erpnext.startup.start = function() {
if(wn.boot.custom_css) {
set_style(wn.boot.custom_css);
}
if(wn.boot.user_background) {
erpnext.set_user_background(wn.boot.user_background);
}
if(user == 'Guest'){
if(wn.boot.website_settings.title_prefix) {
@ -58,7 +61,7 @@ erpnext.startup.start = function() {
} else {
// setup toolbar
erpnext.toolbar.setup();
// set interval for updates
erpnext.startup.set_periodic_updates();
@ -66,6 +69,13 @@ erpnext.startup.start = function() {
// ------------------
$('footer').html('<div class="web-footer erpnext-footer">\
Powered by <a href="https://erpnext.com">ERPNext</a></div>');
// complete registration
if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) {
wn.require("erpnext/startup/js/complete_setup.js");
erpnext.complete_setup();
}
}
$('#startup_div').toggle(false);
@ -87,28 +97,6 @@ show_chart_browser = function(nm, chart_type){
}
// Module Page
// ====================================================================
ModulePage = function(parent, module_name, module_label, help_page, callback) {
this.parent = parent;
// add to current page
page_body.cur_page.module_page = this;
this.wrapper = $a(parent,'div');
this.module_name = module_name;
this.transactions = [];
this.page_head = new PageHeader(this.wrapper, module_label);
if(help_page) {
var btn = this.page_head.add_button('Help', function() { loadpage(this.help_page) }, 1, 'ui-icon-help')
btn.help_page = help_page;
}
if(callback) this.callback = function(){ callback(); }
}
// ========== Update Messages ============
var update_messages = function() {
// Updates Team Messages
@ -147,6 +135,10 @@ erpnext.startup.set_periodic_updates = function() {
wn.updates.id = setInterval(update_messages, 60000);
}
erpnext.set_user_background = function(src) {
set_style(repl('body { background: url("files/%(src)s") repeat !important;}', {src:src}))
}
// =======================================
// start

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:35',
'docstatus': 0,
'modified': '2012-02-07 13:28:20',
'modified': '2012-02-29 17:55:13',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -22,7 +22,6 @@
# These values are common for all Field Mapper Detail
{
'doctype': u'Field Mapper Detail',
'map': u'Yes',
'name': '__common__',
'parent': u'Purchase Order-Purchase Receipt',
'parentfield': u'field_mapper_details',
@ -50,6 +49,7 @@
'checking_operator': u'=',
'doctype': u'Field Mapper Detail',
'from_field': u'supplier',
'map': u'Yes',
'match_id': 0,
'to_field': u'supplier'
},
@ -59,6 +59,7 @@
'checking_operator': u'=',
'doctype': u'Field Mapper Detail',
'from_field': u'company',
'map': u'Yes',
'match_id': 0,
'to_field': u'company'
},
@ -68,6 +69,7 @@
'checking_operator': u'=',
'doctype': u'Field Mapper Detail',
'from_field': u'currency',
'map': u'Yes',
'match_id': 0,
'to_field': u'currency'
},
@ -76,6 +78,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'name',
'map': u'Yes',
'match_id': 1,
'to_field': u'prevdoc_detail_docname'
},
@ -84,6 +87,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'parent',
'map': u'Yes',
'match_id': 1,
'to_field': u'prevdoc_docname'
},
@ -92,6 +96,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'parenttype',
'map': u'Yes',
'match_id': 1,
'to_field': u'prevdoc_doctype'
},
@ -101,6 +106,7 @@
'checking_operator': u'=',
'doctype': u'Field Mapper Detail',
'from_field': u'item_code',
'map': u'Yes',
'match_id': 1,
'to_field': u'item_code'
},
@ -109,6 +115,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) ',
'map': u'Yes',
'match_id': 1,
'to_field': u'received_qty'
},
@ -117,6 +124,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) ',
'map': u'Yes',
'match_id': 1,
'to_field': u'qty'
},
@ -125,6 +133,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.conversion_factor)',
'map': u'Yes',
'match_id': 1,
'to_field': u'stock_qty'
},
@ -133,6 +142,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.import_rate)',
'map': u'Yes',
'match_id': 1,
'to_field': u'import_amount'
},
@ -141,6 +151,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.purchase_rate)',
'map': u'Yes',
'match_id': 1,
'to_field': u'amount'
},
@ -149,6 +160,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'schedule_date',
'map': u'Yes',
'match_id': 1,
'to_field': u'schedule_date'
},
@ -157,6 +169,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'net_total',
'map': u'Yes',
'match_id': 0,
'to_field': u'net_total'
},
@ -165,6 +178,7 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'grand_total',
'map': u'Yes',
'match_id': 0,
'to_field': u'grand_total'
},
@ -173,14 +187,25 @@
{
'doctype': u'Field Mapper Detail',
'from_field': u'total_tax',
'map': u'Yes',
'match_id': 0,
'to_field': u'total_tax'
},
# Field Mapper Detail
{
'doctype': u'Field Mapper Detail',
'from_field': u'transaction_date',
'map': u'No',
'match_id': 0,
'to_field': u'transaction_date'
},
# Field Mapper Detail
{
'doctype': u'Field Mapper Detail',
'from_field': u'conversion_rate',
'map': u'Yes',
'match_id': 0,
'to_field': u'conversion_rate'
},

View File

@ -4,7 +4,7 @@
<h1>Stock</h1>
<hr>
<div style="width: 48%; float: left;">
<h4><a ahref="#!List/Stock Entry">Stock Entry</a></h4>
<h4><a href="#!List/Stock Entry">Stock Entry</a></h4>
<p class="help">Transfer stock from one warehouse to another</p>
<h4><a href="#!List/Delivery Note">Delivery Note</a></h4>
<p class="help">Delivery (shipment) to customers</p>

View File

@ -23,6 +23,7 @@ def get_report_list(arg=None):
distinct criteria_name, doc_type, parent_doc_type
from `tabSearch Criteria`
where module='%(module)s'
and docstatus in (0, NULL)
and docstatus in (0, NULL)
and ifnull(disabled, 0) = 0
order by criteria_name
limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True)

View File

@ -65,7 +65,7 @@ erpnext.messages = {
$(wn.pages.messages).find('.well').toggle(contact==user ? false : true);
$(wn.pages.messages).find('h1:first').html('Messages: '
+ (user==contact ? 'From everyone' : wn.boot.user_fullnames[contact]))
+ (user==contact ? 'From everyone' : wn.user_info(contact).fullname));
erpnext.messages.contact = contact;
erpnext.messages.list.opts.args.contact = contact;
@ -98,7 +98,7 @@ erpnext.messages = {
},
render_row: function(wrapper, data) {
data.creation = dateutil.comment_when(data.creation);
data.comment_by_fullname = wn.boot.user_fullnames[data.owner];
data.comment_by_fullname = wn.user_info(data.owner).fullname;
data.reply_html = '';
if(data.owner==user) {
@ -143,7 +143,7 @@ erpnext.messages = {
var $body = $(wn.pages.messages).find('.section-body');
for(var i in r.message) {
var p = r.message[i];
p.fullname = wn.boot.user_fullnames[p.name];
p.fullname = wn.user_info(p.name).fullname;
p.name = p.name.replace('@', '__at__');
$body.append(repl('<div class="section-item">\
<a href="#!messages/%(name)s">%(fullname)s</a></div>', p))

View File

@ -46,14 +46,22 @@ erpnext.todo.ToDoItem = Class.extend({
}
todo.labelclass = label_map[todo.priority];
todo.userdate = dateutil.str_to_user(todo.date);
if(todo.reference_name && todo.reference_type) {
todo.link = repl('<a href="#!Form/%(reference_type)s/%(reference_name)s">\
%(reference_name)s</a>', todo);
} else if(todo.reference_type) {
todo.link = repl('<a href="#!List/%(reference_type)s">\
%(reference_type)s</a>', todo);
} else {
todo.link = '';
}
$('#todo-list').append(repl('<div class="todoitem">\
<span class="description">\
<span class="label %(labelclass)s">%(priority)s</span>\
<span class="help" style="margin-right: 7px">%(userdate)s</span>\
%(description)s</span>\
<span class="ref_link">&rarr;\
<a href="#!Form/%(reference_type)s/%(reference_name)s">\
[%(reference_name)s]</a></span>\
%(link)s</span>\
<a href="#" class="close">&times;</a>\
</div>', todo));
$todo = $('div.todoitem:last');
@ -62,7 +70,7 @@ erpnext.todo.ToDoItem = Class.extend({
$todo.find('.description').css('text-decoration', 'line-through');
}
if(!todo.reference_name)
if(!todo.reference_type)
$todo.find('.ref_link').toggle(false);
$todo.find('.description')
@ -145,4 +153,4 @@ erpnext.todo.save = function(btn) {
wn.pages.todo.onload = function() {
// load todos
erpnext.todo.refresh();
}
}

View File

@ -66,11 +66,11 @@ $.extend(wn.pages.users, {
},
render: function(data) {
if(data.file_list) {
data.imgsrc = 'files/' + data.files_list.split('\n')[0].split(',')[1];
data.imgsrc = 'files/' + data.file_list.split('\n')[0].split(',')[1];
} else {
data.imgsrc = 'lib/images/ui/no_img_' + (data.gender=='Female' ? 'f' : 'm');
data.imgsrc = 'lib/images/ui/no_img_' + (data.gender=='Female' ? 'f' : 'm') + '.gif';
}
data.fullname = wn.boot.user_fullnames[data.name];
data.fullname = wn.user_info(data.name).fullname;
data.delete_html = '';
if(!data.enabled)
data.delete_html = '<a class="close" title="delete">&times;</a>';
@ -232,6 +232,7 @@ $.extend(wn.pages.users, {
$c_page('utilities', 'users', 'add_user', v, function(r,rt) {
if(r.exc) { msgprint(r.exc); return; }
else {
wn.boot.user_info[v.user] = {fullname:v.first_name + ' ' + v.last_name};
d.hide();
me.refresh();
}

View File

@ -154,7 +154,8 @@ def send_welcome_mail(email, args):
args.update({
'company': webnotes.conn.get_default('company'),
'password': args.get('password'),
'account_url': webnotes.conn.get_default('account_url')
'account_url': webnotes.conn.get_value('Website Settings',
'Website Settings', 'subdomain') or ""
})
if not args.get('last_name'): args['last_name'] = ''
sendmail_md(pr.email, subject="Welcome to ERPNext", msg=welcome_txt % args, from_defs=1)
@ -189,4 +190,4 @@ password: %(password)s
To login to your new ERPNext account, please go to:
%(account_url)s
"""
"""

View File

@ -1,6 +1,6 @@
body {
{% if doc.background_image %}
background: url("files/{{ doc.background_image }}") repeat !important;
background: url("files/{{ doc.background_image }}") repeat;
{% elif doc.background_color %}
background-color: #{{ doc.background_color }};
{% endif %}

View File

@ -4,7 +4,7 @@
<h1>Support</h1>
<hr>
<div style="width: 48%; float: left;">
<h4><a ahref="#!List/Web Page">Web Page</a></h4>
<h4><a href="#!List/Web Page">Web Page</a></h4>
<p class="help">Static (content) web page</p>
<h4><a href="#!List/Product">Product</a></h4>
<p class="help">Product listed in catolog</p>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
755
774