Merge branch 'develop'
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index 1a2000a..edf498b 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
from __future__ import unicode_literals
-__version__ = '6.7.2'
+__version__ = '6.7.3'
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 86ff9c8..6f6e07a 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -29,7 +29,7 @@
"""
app_icon = "icon-th"
app_color = "#e74c3c"
-app_version = "6.7.2"
+app_version = "6.7.3"
source_link = "https://github.com/frappe/erpnext"
error_report_email = "support@erpnext.com"
diff --git a/erpnext/patches/v6_6/remove_fiscal_year_from_leave_allocation.py b/erpnext/patches/v6_6/remove_fiscal_year_from_leave_allocation.py
index 1b24841..b150173 100644
--- a/erpnext/patches/v6_6/remove_fiscal_year_from_leave_allocation.py
+++ b/erpnext/patches/v6_6/remove_fiscal_year_from_leave_allocation.py
@@ -2,14 +2,15 @@
import frappe
def execute():
- for leave_allocation in frappe.db.sql("select name, fiscal_year from `tabLeave Allocation`", as_dict=True):
- year_start_date, year_end_date = frappe.db.get_value("Fiscal Year", leave_allocation["fiscal_year"],
- ["year_start_date", "year_end_date"])
-
- frappe.db.sql("""update `tabLeave Allocation`
- set from_date=%s, to_date=%s where name=%s""",
- (year_start_date, year_end_date, leave_allocation["name"]))
-
- frappe.db.commit()
-
-
\ No newline at end of file
+ if frappe.db.has_column("Leave Allocation", "fiscal_year"):
+ for leave_allocation in frappe.db.sql("select name, fiscal_year from `tabLeave Allocation`", as_dict=True):
+ dates = frappe.db.get_value("Fiscal Year", leave_allocation["fiscal_year"],
+ ["year_start_date", "year_end_date"])
+
+ if dates:
+ year_start_date, year_end_date = dates
+
+ frappe.db.sql("""update `tabLeave Allocation`
+ set from_date=%s, to_date=%s where name=%s""",
+ (year_start_date, year_end_date, leave_allocation["name"]))
+
diff --git a/setup.py b/setup.py
index 0150873..bcf7177 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = "6.7.2"
+version = "6.7.3"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()