Merge pull request #7802 from KanchanChauhan/multiple-items-purchase

[Fix] Throw error if item is added multiple time
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 6fff4ce..7d0ac97 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -374,3 +374,4 @@
 erpnext.patches.v7_2.setup_auto_close_settings
 erpnext.patches.v7_2.empty_supplied_items_for_non_subcontracted
 erpnext.patches.v7_2.arrear_leave_encashment_as_salary_component
+erpnext.patches.v7_2.rename_att_date_attendance
diff --git a/erpnext/patches/v7_2/rename_att_date_attendance.py b/erpnext/patches/v7_2/rename_att_date_attendance.py
new file mode 100644
index 0000000..f7caf70
--- /dev/null
+++ b/erpnext/patches/v7_2/rename_att_date_attendance.py
@@ -0,0 +1,14 @@
+import frappe
+from frappe.model.utils.rename_field import update_reports, update_users_report_view_settings, update_property_setters
+
+def execute():
+	if "att_date" not in frappe.db.get_table_columns("Attendance"):
+		return
+	frappe.reload_doc("hr", "doctype", "attendance")
+	frappe.db.sql("""update `tabAttendance` 
+	 		set attendance_date = att_date
+			where attendance_date is null or attendance_date = '' or attendance_date = '0000-00-00'""")
+	
+	update_reports("Attendance", "att_date", "attendance_date")
+	update_users_report_view_settings("Attendance", "att_date", "attendance_date")
+	update_property_setters("Attendance", "att_date", "attendance_date")