Fiscal Year removed from Material Request
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 5476d14..3dfd7e1 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -14,19 +14,21 @@
},
get_fiscal_year: function(company, date, fn) {
- frappe.call({
- type:"GET",
- method: "erpnext.accounts.utils.get_fiscal_year",
- args: {
- "company": company,
- "date": date,
- "verbose": 0
- },
- callback: function(r) {
- if (r.message) cur_frm.set_value("fiscal_year", r.message[0]);
- if (fn) fn();
- }
- });
+ if(frappe.meta.get_docfield(cur_frm.doctype, "fiscal_year")) {
+ frappe.call({
+ type:"GET",
+ method: "erpnext.accounts.utils.get_fiscal_year",
+ args: {
+ "company": company,
+ "date": date,
+ "verbose": 0
+ },
+ callback: function(r) {
+ if (r.message) cur_frm.set_value("fiscal_year", r.message[0]);
+ if (fn) fn();
+ }
+ });
+ }
},
toggle_naming_series: function() {