Merge branch 'master' into perpetual

This commit is contained in:
Nabin Hait
2013-08-07 12:46:50 +05:30
23 changed files with 298 additions and 123 deletions

View File

@@ -2,17 +2,6 @@
// License: GNU General Public License v3. See license.txt
wn.provide('erpnext');
erpnext.set_about = function() {
wn.provide('wn.app');
$.extend(wn.app, {
name: 'ERPNext',
license: 'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',
source: 'https://github.com/webnotes/erpnext',
publisher: 'Web Notes Technologies Pvt Ltd, Mumbai',
copyright: '© Web Notes Technologies Pvt Ltd',
version: 'Please see git log for the release number'
});
}
wn.modules_path = 'erpnext';
@@ -31,3 +20,24 @@ $(document).bind('toolbar_setup', function() {
"white-space": "nowrap"
});
});
wn.provide('wn.ui.misc');
wn.ui.misc.about = function() {
if(!wn.ui.misc.about_dialog) {
var d = new wn.ui.Dialog({title:'About ERPNext'})
$(d.body).html(repl("<div>\
<p>ERPNext is an open-source web based ERP made by Web Notes Technologies Pvt Ltd.\
to provide an integrated tool to manage most processes in a small organization.\
For more information about Web Notes, or to buy hosting servies, go to \
<a href='https://erpnext.com'>https://erpnext.com</a>.</p>\
<p>To report an issue, go to <a href='https://github.com/webnotes/erpnext/issues'>GitHub Issues</a></p>\
<hr>\
<p><a href='http://www.gnu.org/copyleft/gpl.html'>License: GNU General Public License Version 3</a></p>\
</div>", wn.app));
wn.ui.misc.about_dialog = d;
}
wn.ui.misc.about_dialog.show();
}

View File

@@ -43,7 +43,6 @@ erpnext.startup.start = function() {
</div>', { expiry_string: expiry_string, payment_link: payment_link }));
}
}
erpnext.set_about();
}
}

View File

@@ -32,6 +32,21 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
}
},
onload_post_render: function() {
if(this.frm.doc.__islocal && this.frm.doc.company && !this.frm.doc.customer) {
var me = this;
return this.frm.call({
doc: this.frm.doc,
method: "onload_post_render",
freeze: true,
callback: function(r) {
// remove this call when using client side mapper
me.set_default_values();
}
});
}
},
refresh: function() {
this.frm.clear_custom_buttons();
erpnext.hide_naming_series();
@@ -44,6 +59,17 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
this.calculate_taxes_and_totals();
},
set_default_values: function() {
$.each(wn.model.get_doclist(this.frm.doctype, this.frm.docname), function(i, doc) {
var updated = wn.model.set_default_values(doc);
if(doc.parentfield) {
refresh_field(doc.parentfield);
} else {
refresh_field(updated);
}
});
},
company: function() {
if(this.frm.doc.company && this.frm.fields_dict.currency) {
if(!this.frm.doc.currency) {