minor fixes in utils, purchase common and task
This commit is contained in:
parent
fd6d2e0d2f
commit
88ac485541
@ -68,15 +68,15 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
|
|||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
me.price_list_currency();
|
me.price_list_currency();
|
||||||
if (callback_fn) callback_fn(me.frm.doc, me.frm.doc.doctype,
|
if (typeof callback_fn === "function")
|
||||||
me.frm.doc.name);
|
callback_fn(me.frm.doc, me.frm.doc.doctype, me.frm.doc.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
me.price_list_currency();
|
me.price_list_currency();
|
||||||
if (callback_fn) callback_fn(me.frm.doc, me.frm.doc.doctype,
|
if (typeof callback_fn === "function")
|
||||||
me.frm.doc.name);
|
callback_fn(me.frm.doc, me.frm.doc.doctype, me.frm.doc.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -29,7 +29,8 @@ erpnext.projects.Task = erpnext.utils.Controller.extend({
|
|||||||
|
|
||||||
project: function() {
|
project: function() {
|
||||||
if(this.frm.doc.project) {
|
if(this.frm.doc.project) {
|
||||||
get_server_fields('get_project_details', '','', doc, cdt, cdn, 1);
|
get_server_fields('get_project_details', '','', this.frm.doc, this.frm.doc.doctype,
|
||||||
|
this.frm.doc.name, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -26,31 +26,7 @@ erpnext.get_currency = function(company) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
erpnext.utils.Controller = Class.extend({
|
erpnext.utils.Controller = wn.ui.form.Controller.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);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
erpnext.hide_naming_series();
|
erpnext.hide_naming_series();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user