mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 23:49:19 +00:00
[minor] [fix] bring back onload_post_render in transaction.js - ref: a9b1c09166
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
|||||||
@@ -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() {
|
refresh: function() {
|
||||||
this.frm.clear_custom_buttons();
|
this.frm.clear_custom_buttons();
|
||||||
erpnext.hide_naming_series();
|
erpnext.hide_naming_series();
|
||||||
@@ -44,6 +59,17 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
this.calculate_taxes_and_totals();
|
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() {
|
company: function() {
|
||||||
if(this.frm.doc.company && this.frm.fields_dict.currency) {
|
if(this.frm.doc.company && this.frm.fields_dict.currency) {
|
||||||
if(!this.frm.doc.currency) {
|
if(!this.frm.doc.currency) {
|
||||||
|
|||||||
Reference in New Issue
Block a user