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

Conflicts:
	version.num
This commit is contained in:
Anand Doshi 2012-03-01 13:51:23 +05:30
commit 552093c3fd
25 changed files with 204 additions and 173 deletions

View File

@ -37,7 +37,6 @@
{
"css/all-web.css": [
"lib/css/legacy/body.css",
"lib/css/legacy/menus.css",
"lib/css/legacy/messages.css",
"lib/css/legacy/dialog.css",
"lib/css/bootstrap/headings.css",
@ -53,7 +52,6 @@
{
"css/all-app.css": [
"lib/css/legacy/body.css",
"lib/css/legacy/menus.css",
"lib/css/legacy/messages.css",
"lib/css/legacy/forms.css",
"lib/css/legacy/grid.css",

View File

@ -230,59 +230,16 @@ div.std-footer-item {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
/*
* lib/css/legacy/menus.css
*/
/******** Menus - menu.js ************/
ul.menu_toolbar {
z-index: 30;
padding: 0px;
margin: 0px;
margin-top: 1px;
.avatar-small {
display: inline-block;
min-width: 29px;
}
.avatar-small img {
height: 24px;
margin-bottom: -7px;
max-width: 24px;
}
ul.menu_toolbar li {
list-style: none;
margin: 0px;
float: left;
}
.top_menu {
margin: 0px;
padding: 4px;
cursor: pointer;
color: #FFF;
margin-right: 8px;
}
.top_menu_mo {
background-color: #000;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
div.menu_toolbar_dropdown {
position: absolute;
margin-top: 4px;
margin-left: 8px;
width: 140px;
background-color: #FFF;
color: #000;
display: none;
border: 2px solid #333;
z-index: 31;
overflow-y: auto;
overflow-x: hidden;
}
div.dd_item {
cursor: pointer;
padding: 4px;
background-color: #FFF;
}
div.dd_item_mo { background-color: #FE8; }
/*
* lib/css/legacy/messages.css
*/
@ -2812,7 +2769,7 @@ body {
}
.erpnext-footer {
margin: 3px auto;
margin: 11px auto;
text-align: center;
}

View File

@ -230,59 +230,16 @@ div.std-footer-item {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
/*
* lib/css/legacy/menus.css
*/
/******** Menus - menu.js ************/
ul.menu_toolbar {
z-index: 30;
padding: 0px;
margin: 0px;
margin-top: 1px;
.avatar-small {
display: inline-block;
min-width: 29px;
}
.avatar-small img {
height: 24px;
margin-bottom: -7px;
max-width: 24px;
}
ul.menu_toolbar li {
list-style: none;
margin: 0px;
float: left;
}
.top_menu {
margin: 0px;
padding: 4px;
cursor: pointer;
color: #FFF;
margin-right: 8px;
}
.top_menu_mo {
background-color: #000;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
div.menu_toolbar_dropdown {
position: absolute;
margin-top: 4px;
margin-left: 8px;
width: 140px;
background-color: #FFF;
color: #000;
display: none;
border: 2px solid #333;
z-index: 31;
overflow-y: auto;
overflow-x: hidden;
}
div.dd_item {
cursor: pointer;
padding: 4px;
background-color: #FFF;
}
div.dd_item_mo { background-color: #FE8; }
/*
* lib/css/legacy/messages.css
*/
@ -1620,7 +1577,7 @@ body {
}
.erpnext-footer {
margin: 3px auto;
margin: 11px auto;
text-align: center;
}

View File

@ -45,11 +45,14 @@ cur_frm.cscript.onload = function(doc,dt,dn) {
//------------------------
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
var callback = function(doc, dt, dn) {
var callback1 = function(doc, dt, dn) {
if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn);
}
// defined in purchase_common.js
cur_frm.cscript.update_item_details(doc, cdt, cdn, callback);
cur_frm.cscript.update_item_details(doc, dt, dn, callback1);
}
cur_frm.cscript.dynamic_label(doc, dt, dn, callback);
}
// Refresh
@ -58,7 +61,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
cur_frm.clear_custom_buttons();
cur_frm.cscript.dynamic_label(doc, cdt, cdn);
if (!cur_frm.cscript.is_onload) cur_frm.cscript.dynamic_label(doc, dt, dn);
// Show / Hide button

View File

@ -168,9 +168,6 @@ class DocType(TransactionBase):
return ret
def get_comp_base_currency(self):
return get_obj('Purchase Common').get_comp_base_currency(self.doc.company)
# *************************** Server Utility Functions *****************************
# Get Company abbr

View File

@ -101,7 +101,6 @@ var set_dynamic_label_child = function(doc, cdt, cdn, base_curr) {
var hide = (doc.currency == sys_defaults['currency']) ? false : true;
for (f in item_cols_base) cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp(f, hide);
if (doc.doctype == 'Payable Voucher') {
$('[data-grid-fieldname="'+cur_frm.cscript.tname+'-rate"]').html('Rate ('+base_curr+')');
cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp('rate', hide);
@ -117,14 +116,12 @@ var set_dynamic_label_child = function(doc, cdt, cdn, base_curr) {
//tax table flds
tax_cols = {'tax_amount': 'Amount', 'total': 'Aggregate Total'};
for (d in tax_cols) $('[data-grid-fieldname="Purchase Tax Detail-'+d+'"]').html(tax_cols[d]+' ('+base_curr+')');
}
// Change label dynamically based on currency
//------------------------------------------------------------------
cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) {
cur_frm.cscript.dynamic_label = function(doc, cdt, cdn, callback1) {
var callback = function(r, rt) {
if (r.message) base_curr = r.message;
else base_curr = sys_defaults['currency'];
@ -136,10 +133,16 @@ cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) {
set_dynamic_label_par(doc, cdt, cdn, base_curr);
set_dynamic_label_child(doc, cdt, cdn, base_curr);
if(callback1) callback1(doc, cdt, cdn);
}
if (doc.company == sys_defaults['company']) callback('', '');
else $c_obj(make_doclist(doc.doctype, doc.name), 'get_comp_base_currency', '', callback);
else wn.call({
method: 'selling.doctype.sales_common.sales_common.get_comp_base_currency',
args: {company: doc.company},
callback: callback
});
}
cur_frm.cscript.currency = function(doc, cdt, cdn) {

View File

@ -197,11 +197,6 @@ class DocType(TransactionBase):
msgprint("%s has no Last Purchase Rate."% d.item_code)
def get_comp_base_currency(self, comp):
""" get default currency of company"""
return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", comp)[0][0]
# validation
# -------------------------------------------------------------------------------------------------------

View File

@ -41,9 +41,12 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) {
var callback = function(doc, cdt, cdn) {
if(doc.__islocal){
cur_frm.cscript.get_default_schedule_date(doc);
}
}
cur_frm.cscript.dynamic_label(doc, cdt, cdn, callback);
}
// ================================== Refresh ==========================================
@ -52,7 +55,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
// ---------------------------------
cur_frm.clear_custom_buttons();
cur_frm.cscript.dynamic_label(doc, cdt, cdn);
if (!cur_frm.cscript.is_onload) cur_frm.cscript.dynamic_label(doc, cdt, cdn);
if(doc.docstatus == 1 && doc.status != 'Stopped'){
var ch = getchildren('PO Detail',doc.name,'po_details');

View File

@ -100,10 +100,6 @@ class DocType(TransactionBase):
return get_obj('Purchase Common').get_tc_details(self)
def get_comp_base_currency(self):
return get_obj('Purchase Common').get_comp_base_currency(self.doc.company)
# validate if indent has been pulled twice
def validate_prev_docname(self):

View File

@ -15,8 +15,7 @@ erpnext.ActivityFeed = Class.extend({
this.scrub_data(data);
this.add_date_separator(row, data);
$(row).append(sprintf('<div style="margin: 0px">\
<img src="%(imgsrc)s" style= "height: 24px; margin-bottom: -7px; \
max-width: 24px; margin-right: 5px"> \
<span class="avatar-small"><img src="%(imgsrc)s" /></span> \
<span %(onclick)s class="label %(add_class)s">%(feed_type)s</span>\
%(link)s %(subject)s <span class="user-info">%(by)s</span></div>', data));
},

View File

@ -0,0 +1,91 @@
<div class="layout-wrapper">
<a class="close" onclick="window.history.back();">&times;</a>
<h1>Attributions</h1>
<hr>
<p><b>Source Code:</b> <a href="https://github.com/webnotes/erpnext">
https://github.com/webnotes/erpnext</a></p>
<p><b>Website:</b> <a href="https://erpnext.com">
https://erpnext.com</a></p>
<hr>
<p class="help">ERPNext is an Open Source project and is possible because of the work of
thousands of software developers, companies and designers who have contributed their
work to the community. We have tried to list as many projects as possible that are
used by ERPNext, but this list may not be exhaustive.</p>
<h4>Server</h4>
<ul>
<li>Linux (GNU)</li>
<li>Apache HTTPD server (web server)</li>
<li>MySQL (database, Percona build)</li>
<li>Git (source code control via Github)</li>
</ul>
<h4>Programming Languages & Libraries</h4>
<ul>
<li><a href="http://python.org">Python</a></li>
<ul>
<li>Python-MySQL</li>
<li>pytz (timezones)</li>
<li>jinja2 (templating)</li>
<li>markdown2 (markdown parser)</li>
<li>jsmin (javascript minifier)</li>
</ul>
<li>Javascript</li>
<ul>
<li>JQuery</li>
<li>JQuery UI (datepicker, sortable)</li>
<li>TinyMCE - text editor</li>
<li>Twitter Bootstrap</li>
<li>jQPlot - graphs</li>
<li>JSON2 - JSON builder, parser</li>
<li>JSColor - color picker</li>
<li>sprintf - string formatting</li>
<li>historyjs - AJAX history</li>
</ul>
</ul>
<h4>CSS Frameworks</h4>
<ul>
<li>Twitter Bootstrap</li>
</ul>
<h4>Icons</h4>
<ul>
<li>The Noun Project</li>
<li>Glyphicons</li>
</ul>
<h4>Web Frameworks</h4>
<ul>
<li>wnframework</li>
</ul>
<h4>Web Browsers</h4>
<ul>
<li>Mozilla Firefox</li>
<ul>
<li>Firebug (debugger)</li>
</ul>
<li>Apple Safari</li>
<li>Google Chorme</li>
</ul>
<hr>
<h2>ERPNext License</h2>
<p><b>ERPNext - Open Source, web based ERP</b></p>
<p>Copyright &copy; 2008 onwards, Web Notes Technologies Pvt Ltd, India</p>
<p>This program is free software: you can redistribute it and/or modify
it under the terms of the <b>GNU General Public License</b> as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p>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.</p>
<p>For complete license see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a></p>
<hr>
<p>For more information please write to us at support@erpnext.com</p>
</div>

View File

@ -0,0 +1 @@
wn.pages['attributions'].onload = function(wrapper) { }

View File

@ -0,0 +1 @@
import webnotes

View File

@ -0,0 +1,28 @@
# Page, attributions
[
# These values are common in all dictionaries
{
'creation': '2012-03-01 12:30:42',
'docstatus': 0,
'modified': '2012-03-01 12:30:42',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Page
{
'doctype': 'Page',
'module': u'Home',
'name': '__common__',
'page_name': u'attributions',
'standard': u'Yes',
'title': u'Attributions'
},
# Page, attributions
{
'doctype': 'Page',
'name': u'attributions'
}
]

View File

@ -35,6 +35,7 @@ def execute():
reload_doc('setup', 'page', 'modules_setup')
reload_doc('utilities', 'page', 'users')
reload_doc('home', 'page', 'activity')
reload_doc('home', 'page', 'attributions')
reload_doc('core', 'doctype', 'profile')
# update user_image in profile

View File

@ -16,7 +16,7 @@ body {
}
.erpnext-footer {
margin: 3px auto;
margin: 11px auto;
text-align: center;
}

View File

@ -62,7 +62,7 @@ erpnext.startup.start = function() {
} else {
// always allow apps
wn.boot.profile.allow_modules = wn.boot.profile.allow_modules.concat(
['To Do', 'Knowledge Base', 'Calendar', 'Activity'])
['To Do', 'Knowledge Base', 'Calendar', 'Activity', 'Messages'])
// setup toolbar
erpnext.toolbar.setup();
@ -73,7 +73,7 @@ erpnext.startup.start = function() {
// border to the body
// ------------------
$('footer').html('<div class="web-footer erpnext-footer">\
Powered by <a href="https://erpnext.com">ERPNext</a></div>');
<a href="#!attributions">ERPNext | Attributions and License</a></div>');
// complete registration
if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) {

View File

@ -40,12 +40,15 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
var callback = function(doc, dt, dn) {
var callback1 = function(doc, dt, dn) {
if(doc.__islocal){
cur_frm.cscript.get_default_schedule_date(doc);
}
}
// defined in purchase_common.js
cur_frm.cscript.update_item_details(doc, cdt, cdn, callback);
cur_frm.cscript.update_item_details(doc, dt, dn, callback1);
}
cur_frm.cscript.dynamic_label(doc, dt, dn, callback);
}
//========================== Refresh ===============================================================
@ -55,7 +58,8 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
// ---------------------------------
cur_frm.clear_custom_buttons();
cur_frm.cscript.dynamic_label(doc, cdt, cdn);
if (!cur_frm.cscript.is_onload) cur_frm.cscript.dynamic_label(doc, cdt, cdn);
if(doc.docstatus == 1){
var ch = getchildren('Purchase Receipt Detail',doc.name,'purchase_receipt_details');

View File

@ -88,10 +88,6 @@ class DocType(TransactionBase):
def get_tc_details(self):
return get_obj('Purchase Common').get_tc_details(self)
def get_comp_base_currency(self):
return get_obj('Purchase Common').get_comp_base_currency(self.doc.company)
# get available qty at warehouse
def get_bin_details(self, arg = ''):

View File

@ -48,7 +48,8 @@ def get_list(arg=None):
@webnotes.whitelist()
def get_active_users(arg=None):
return webnotes.conn.sql("""select name from tabProfile
where enabled=1 and
where ifnull(enabled,0)=1 and
docstatus < 2 and
name not in ('Administrator', 'Guest')
order by first_name""", as_dict=1)

View File

@ -2234,9 +2234,9 @@ erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_p
if(inList(user_roles,'System Manager'))is_system_manager=1;}
erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();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){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity'])
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages'])
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
Powered by <a href="https://erpnext.com">ERPNext</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
<a href="#!attributions">ERPNext | Attributions and License</a></div>');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);}
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
else if(nm=='Accounts Browser')

View File

@ -1082,9 +1082,9 @@ erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_p
if(inList(user_roles,'System Manager'))is_system_manager=1;}
erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();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){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity'])
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages'])
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
Powered by <a href="https://erpnext.com">ERPNext</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
<a href="#!attributions">ERPNext | Attributions and License</a></div>');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);}
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
else if(nm=='Accounts Browser')