Run trigger of company field on onload function, even if company exists
This commit is contained in:
parent
06cf2c7b51
commit
bc408d8d0b
@ -20,13 +20,18 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||
currency: currency,
|
||||
price_list_currency: currency,
|
||||
status: "Draft",
|
||||
company: frappe.defaults.get_user_default("company"),
|
||||
fiscal_year: frappe.defaults.get_user_default("fiscal_year"),
|
||||
is_subcontracted: "No",
|
||||
}, function(fieldname, value) {
|
||||
if(me.frm.fields_dict[fieldname] && !me.frm.doc[fieldname])
|
||||
me.frm.set_value(fieldname, value);
|
||||
});
|
||||
|
||||
if(!this.frm.doc.company) {
|
||||
this.frm.set_value("company", frappe.defaults.get_user_default("company"));
|
||||
} else {
|
||||
cur_frm.script_manager.trigger("company");
|
||||
}
|
||||
}
|
||||
|
||||
if(this.other_fname) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user