Skip to content

Commit 4ebb383

Browse files
committed
fix: add warning for PDF processor changes with setup instructions
1 parent 356e213 commit 4ebb383

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

transaction_parser/transaction_parser/doctype/transaction_parser_settings/transaction_parser_settings.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,23 @@ def validate(self):
6363
self.validate_incoming_email_accounts()
6464
self.validate_party_email()
6565
self.validate_json_fields()
66+
self.warn_on_pdf_processor_change()
67+
68+
def warn_on_pdf_processor_change(self):
69+
if not self.has_value_changed("pdf_processor"):
70+
return
71+
72+
frappe.msgprint(
73+
_(
74+
"Make sure the required dependencies for {0} are installed.<br>"
75+
"See {1} for setup instructions."
76+
).format(
77+
frappe.bold(self.pdf_processor),
78+
'<a href="https://github.com/resilient-tech/transaction-parser#pdf-processor-setup" target="_blank">PDF Processor Setup</a>',
79+
),
80+
title=_("PDF Processor Changed"),
81+
indicator="orange",
82+
)
6683

6784
def validate_lookback_count(self):
6885
if self.invoice_lookback_count <= 0:

0 commit comments

Comments
 (0)