erpnext
erpnext copied to clipboard
Quickbooks Migrator fails on active years
Information about bug
Using the Quickbooks Migrator, the data was being migrated in until it reached the Journal Items. The generated about 601 errors because many of them were in previous years and they are not active. This was with a brand new instance of erpnext.
Module
accounts
Version
Frappe Version - 14.7.0 Erpnext Version - 14.1.2
Installation method
manual install
Relevant log output / Stack trace / Full Error Message.
Exception
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py", line 865, in __save_journal_entry
je.submit()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1015, in submit
return self._submit()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 994, in _submit
return self.save()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 301, in save
return self._save(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 352, in _save
self.run_post_save_methods()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1090, in run_post_save_methods
self.run_method("on_submit")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 928, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1268, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1250, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 925, in fn
return method_object(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 82, in on_submit
self.make_gl_entries()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 828, in make_gl_entries
gl_map = self.build_gl_map()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 796, in build_gl_map
self.get_gl_dict(
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py", line 679, in get_gl_dict
fiscal_years = get_fiscal_years(posting_date, company=self.company)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/utils.py", line 126, in get_fiscal_years
raise FiscalYearError(error_msg)
erpnext.accounts.utils.FiscalYearError: Date 10-19-2021 is not in any active Fiscal Year for <strong>Company Name</strong>
Hi @samjaninf,
I haven't too much idea about the Quickbooks but I am guessing from the error. If any previous year's Quickbooks entry and you are importing it in the erpnext that time is facing the issue. otherwise, create a fiscal year according to the date (10-19-2021) and again try it. If the issue has been resolved then closed it.
Thank You!