mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
fix: Move filter setup to doctype controllers
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.provide("erpnext.accounts.dimensions");
|
||||
frappe.ui.form.on('Fee Schedule', {
|
||||
setup: function(frm) {
|
||||
frm.add_fetch('fee_structure', 'receivable_account', 'receivable_account');
|
||||
@@ -8,6 +9,10 @@ frappe.ui.form.on('Fee Schedule', {
|
||||
frm.add_fetch('fee_structure', 'cost_center', 'cost_center');
|
||||
},
|
||||
|
||||
company: function(frm) {
|
||||
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
|
||||
},
|
||||
|
||||
onload: function(frm) {
|
||||
frm.set_query('receivable_account', function(doc) {
|
||||
return {
|
||||
@@ -50,6 +55,8 @@ frappe.ui.form.on('Fee Schedule', {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.provide("erpnext.accounts.dimensions");
|
||||
|
||||
frappe.ui.form.on('Fee Structure', {
|
||||
setup: function(frm) {
|
||||
frm.add_fetch('company', 'default_receivable_account', 'receivable_account');
|
||||
@@ -8,6 +10,10 @@ frappe.ui.form.on('Fee Structure', {
|
||||
frm.add_fetch('company', 'cost_center', 'cost_center');
|
||||
},
|
||||
|
||||
company: function(frm) {
|
||||
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
|
||||
},
|
||||
|
||||
onload: function(frm) {
|
||||
frm.set_query('academic_term', function() {
|
||||
return {
|
||||
@@ -35,6 +41,8 @@ frappe.ui.form.on('Fee Structure', {
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.provide("erpnext.accounts.dimensions");
|
||||
|
||||
frappe.ui.form.on("Fees", {
|
||||
setup: function(frm) {
|
||||
@@ -9,6 +10,10 @@ frappe.ui.form.on("Fees", {
|
||||
frm.add_fetch("fee_structure", "cost_center", "cost_center");
|
||||
},
|
||||
|
||||
company: function(frm) {
|
||||
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
|
||||
},
|
||||
|
||||
onload: function(frm){
|
||||
frm.set_query("academic_term",function(){
|
||||
return{
|
||||
@@ -45,6 +50,8 @@ frappe.ui.form.on("Fees", {
|
||||
if (!frm.doc.posting_date) {
|
||||
frm.doc.posting_date = frappe.datetime.get_today();
|
||||
}
|
||||
|
||||
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
|
||||
Reference in New Issue
Block a user