fix(tally): Ignore unhandled vouchers silently (#18430)
Vouchers that affect inventory entries but are not of type
Sales, Purchase, Credit Note, Debit Note are not handled.
Custom Vouchers are also not handled.
diff --git a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py
index 12b646d..01eee5b 100644
--- a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py
+++ b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py
@@ -296,7 +296,9 @@
else:
function = voucher_to_journal_entry
try:
- vouchers.append(function(voucher))
+ processed_voucher = function(voucher)
+ if processed_voucher:
+ vouchers.append(processed_voucher)
except:
self.log(voucher)
return vouchers
@@ -342,6 +344,10 @@
account_field = "credit_to"
account_name = encode_company_abbr(self.tally_creditors_account, self.erpnext_company)
price_list_field = "buying_price_list"
+ else:
+ # Do not handle vouchers other than "Purchase", "Debit Note", "Sales" and "Credit Note"
+ # Do not handle Custom Vouchers either
+ return
invoice = {
"doctype": doctype,