Skip to content

Commit

Permalink
fix: Naming series error in Journal Entry template (#35084)
Browse files Browse the repository at this point in the history
(cherry picked from commit f3b3dab)
  • Loading branch information
deepeshgarg007 authored and mergify[bot] committed May 1, 2023
1 parent 5746ddc commit 5759c09
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
// For license information, please see license.txt

frappe.ui.form.on("Journal Entry Template", {
onload: function(frm) {
if(frm.is_new()) {
frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry_template.journal_entry_template.get_naming_series",
callback: function(r){
if(r.message) {
frm.set_df_property("naming_series", "options", r.message.split("\n"));
frm.set_value("naming_series", r.message.split("\n")[0]);
frm.refresh_field("naming_series");
}
}
});
}
},
refresh: function(frm) {
frappe.model.set_default_values(frm.doc);

Expand All @@ -19,18 +34,6 @@ frappe.ui.form.on("Journal Entry Template", {

return { filters: filters };
});

frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry_template.journal_entry_template.get_naming_series",
callback: function(r){
if(r.message){
frm.set_df_property("naming_series", "options", r.message.split("\n"));
frm.set_value("naming_series", r.message.split("\n")[0]);
frm.refresh_field("naming_series");
}
}
});
},
voucher_type: function(frm) {
var add_accounts = function(doc, r) {
Expand Down

0 comments on commit 5759c09

Please sign in to comment.