feat: add optional PDF Button for Sales and Purchase Doctypes (backport #75)#80
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com> (cherry picked from commit 114c2d1) # Conflicts: # pdf_on_submit/locale/de.po # pdf_on_submit/locale/main.pot # pdf_on_submit/pdf_on_submit/doctype/pdf_on_submit_settings/pdf_on_submit_settings.json
This comment was marked as resolved.
This comment was marked as resolved.
Confidence Score: 5/5Safe to merge — all conflict markers from a previous revision are resolved, the permission guard on the new API endpoint is correct, and the JS popup flow works correctly for the happy path. The change is well-structured: a shared generator is extracted cleanly, the boot-info hook is straightforward, and the permission checks on the new endpoint are adequate. The one notable edge case — a misleading error dialog when the user closes the blank popup tab before the XHR returns — is a minor UX issue that does not affect data integrity or security. pdf_on_submit/public/js/pdf_button_utils.js — the popup-closed race condition noted in the inline comment is worth a quick fix before ship.
|
Usecase:
PDF on Submit tries to minimize the clicks needed to create and attach a PDF. In most cases users want to see the PDF as a form of Preview before submission though. Since the PDF On Submit Settings allow now multiple prints with filters and differ from the ERPNext default print it can become cumbersome for the User to go to "Print -> Select the correct format and letterhead -> Press PDF Button"
Solution:
Optionally add a simple "PDF" Button for all enabled Doctypes
Features of the Button:
PDF on Submit Settings:

Button in Form:

Tested
This is an automatic backport of pull request feat: add optional PDF Button for Sales and Purchase Doctypes #75 done by Mergify.