Merge pull request #17441 from nabinhait/pe-ref-exchange-rate-dev

 fix: Always fetch exchange rate from ref document
diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
index 948be64..76efa48 100644
--- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
+++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
@@ -3,6 +3,7 @@
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
+from functools import reduce
 import frappe, csv
 from frappe import _
 from frappe.utils import cstr
diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py
index 876bdcf..88e7c3e 100644
--- a/erpnext/regional/italy/utils.py
+++ b/erpnext/regional/italy/utils.py
@@ -292,7 +292,7 @@
 		"content": invoice_xml
 	})
 	_file.save()
-	return file
+	return _file
 
 @frappe.whitelist()
 def generate_single_invoice(docname):