Removed fiscal year related things from, Recurrent Document, Leave Application, Upload attendance, Stock Reconciliation and Stock Balance
diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py
index 2f5fccc..182b5b7 100644
--- a/erpnext/controllers/recurring_document.py
+++ b/erpnext/controllers/recurring_document.py
@@ -72,7 +72,6 @@
frappe.throw(exception_message)
def make_new_document(reference_doc, date_field, posting_date):
- from erpnext.accounts.utils import get_fiscal_year
new_document = frappe.copy_doc(reference_doc, ignore_no_copy=True)
mcount = month_map[reference_doc.recurring_type]
@@ -90,8 +89,7 @@
date_field: posting_date,
"from_date": from_date,
"to_date": to_date,
- "fiscal_year": get_fiscal_year(posting_date)[0],
- "next_date": get_next_date(from_date, mcount,cint(reference_doc.repeat_on_day_of_month))
+ "next_date": get_next_date(from_date, mcount,cint(reference_doc.repeat_on_day_of_month))
})
# copy document fields
diff --git a/erpnext/controllers/tests/test_recurring_document.py b/erpnext/controllers/tests/test_recurring_document.py
index 7132112..d47c5c7 100644
--- a/erpnext/controllers/tests/test_recurring_document.py
+++ b/erpnext/controllers/tests/test_recurring_document.py
@@ -6,7 +6,6 @@
import frappe.permissions
from erpnext.controllers.recurring_document import date_field_map
from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate, add_days
-from erpnext.accounts.utils import get_fiscal_year
def test_recurring_document(obj, test_records):
frappe.db.set_value("Print Settings", "Print Settings", "send_print_as_pdf", 1)
@@ -20,7 +19,6 @@
"notification_email_address": "test@example.com, test1@example.com, test2@example.com",
"repeat_on_day_of_month": getdate(today).day,
"due_date": None,
- "fiscal_year": get_fiscal_year(today)[0],
"from_date": get_first_day(today),
"to_date": get_last_day(today)
})
diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py
index 5b5910a..83fdd58 100644
--- a/erpnext/hr/doctype/leave_application/test_leave_application.py
+++ b/erpnext/hr/doctype/leave_application/test_leave_application.py
@@ -15,7 +15,6 @@
"company": "_Test Company",
"doctype": "Leave Application",
"employee": "_T-Employee-0001",
- "fiscal_year": "_Test Fiscal Year 2013",
"from_date": "2013-05-01",
"leave_type": "_Test Leave Type",
"posting_date": "2013-01-02",
@@ -25,7 +24,6 @@
"company": "_Test Company",
"doctype": "Leave Application",
"employee": "_T-Employee-0002",
- "fiscal_year": "_Test Fiscal Year 2013",
"from_date": "2013-05-01",
"leave_type": "_Test Leave Type",
"posting_date": "2013-01-02",
@@ -35,7 +33,6 @@
"company": "_Test Company",
"doctype": "Leave Application",
"employee": "_T-Employee-0001",
- "fiscal_year": "_Test Fiscal Year 2013",
"from_date": "2013-01-15",
"leave_type": "_Test Leave Type LWP",
"posting_date": "2013-01-02",
diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py
index 0c5a0ba..49eb8cf 100644
--- a/erpnext/hr/doctype/upload_attendance/upload_attendance.py
+++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py
@@ -41,8 +41,6 @@
return w
def add_data(w, args):
- from erpnext.accounts.utils import get_fiscal_year
-
dates = get_dates(args)
employees = get_active_employees()
existing_attendance_records = get_existing_attendance_records(args)
diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
index 947a093..f0eea5a 100644
--- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
@@ -7,7 +7,7 @@
from __future__ import unicode_literals
import frappe, unittest
from frappe.utils import flt, nowdate, nowtime
-from erpnext.accounts.utils import get_fiscal_year, get_stock_and_account_difference
+from erpnext.accounts.utils import get_stock_and_account_difference
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
from erpnext.stock.stock_ledger import get_previous_sle, update_entries_after
from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import EmptyStockReconciliationItemsError
@@ -97,7 +97,6 @@
sr.posting_date = args.posting_date or nowdate()
sr.posting_time = args.posting_time or nowtime()
sr.company = args.company or "_Test Company"
- sr.fiscal_year = get_fiscal_year(sr.posting_date)[0]
sr.expense_account = args.expense_account or \
("Stock Adjustment - _TC" if frappe.get_all("Stock Ledger Entry") else "Temporary Opening - _TC")
sr.cost_center = args.cost_center or "_Test Cost Center - _TC"
diff --git a/erpnext/stock/stock_balance.py b/erpnext/stock/stock_balance.py
index 708552c..7247d9e 100644
--- a/erpnext/stock/stock_balance.py
+++ b/erpnext/stock/stock_balance.py
@@ -7,7 +7,6 @@
from frappe.utils import flt, cstr, nowdate, nowtime
from erpnext.stock.utils import update_bin
from erpnext.stock.stock_ledger import update_entries_after
-from erpnext.accounts.utils import get_fiscal_year
def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False, only_bin=False):
"""
@@ -158,7 +157,6 @@
fiscal_year=None):
if not posting_date: posting_date = nowdate()
if not posting_time: posting_time = nowtime()
- if not fiscal_year: fiscal_year = get_fiscal_year(posting_date)[0]
condition = " and item.name='%s'" % item_code.replace("'", "\'") if item_code else ""
@@ -191,7 +189,6 @@
'stock_uom' : d[3],
'incoming_rate' : sle and flt(serial_nos[0][0]) > flt(d[2]) and flt(sle[0][0]) or 0,
'company' : sle and cstr(sle[0][1]) or 0,
- 'fiscal_year' : fiscal_year,
'is_cancelled' : 'No',
'batch_no' : '',
'serial_no' : ''