minor fixes in utils, purchase common and task

This commit is contained in:
Anand Doshi
2013-03-11 14:57:45 +05:30
parent fd6d2e0d2f
commit 88ac485541
3 changed files with 7 additions and 30 deletions

View File

@@ -26,31 +26,7 @@ erpnext.get_currency = function(company) {
}
// TODO
erpnext.utils.Controller = Class.extend({
init: function(opts) {
$.extend(this, opts);
this.setup && this.setup();
},
onload_post_render: function() {
if(this.frm.doc.__islocal) {
this.setup_defaults();
}
},
setup_defaults: function() {
var me = this;
var defaults = {
posting_date: wn.datetime.get_today(),
posting_time: wn.datetime.now_time()
}
$.each(defaults, function(k, v) {
if(!me.frm.doc[k]) me.frm.set_value(k, v);
});
},
erpnext.utils.Controller = wn.ui.form.Controller.extend({
refresh: function() {
erpnext.hide_naming_series();
}