[16.0][FIX] disbursement_finance_kmitl: unblock navigation at bills_posted when payment subject is empty - #1260
Merged
coreichamp merged 1 commit intoSep 8, 2026
Conversation
…osted when payment subject is empty payment_subject_id was required in the view exactly at bills_posted, the one state every request arrives at with the field empty (the accounting bridge writes that state; choosing the subject is the auditor's own first job). Every type="object" button save-validates the whole form regardless of dirty state, so the auditor's smart buttons (ใบตั้งหนี้, payments, journal entries, sarabun) were blocked on an untouched form. The requirement is already enforced server-side by _check_payment_classification, the only transition that consumes it, with its own translated UserError and test coverage. Drop the view-level required, keep readonly, and replace the lost asterisk with a non-blocking warning banner reusing the same message.
coreichamp
deleted the
coreichamp/16.0-fix-disbursement_finance_kmitl-audit-subject-required
branch
September 8, 2026 03:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
payment_subject_id(เรื่องที่จ่าย) wasrequiredin the view exactly atbills_posted, the one state every request arrives at with the field empty (the accounting bridge writes that state; choosing the subject is the auditor's own first job).type="object"button (header buttons and smart buttons alike) saves and validates the whole form regardless of whether it's dirty, so the auditor's smart buttons (ใบตั้งหนี้ / payments / journal entries / sarabun) were blocked on an untouched form — locking the auditor out of the very documents they need to decide the subject._check_payment_classification, the only transition that consumes it (action_audit,action_audit_batch,_create_payments), with its own translatedUserErrorand existing test coverage (test_audit_needs_a_subject).required(keptreadonly), and replaced the lost asterisk with a non-blocking warning banner on the Payment Execution page reusing the exact guard message, so the translation is reused (added the view#:reference to the existingth.poentry rather than creating a duplicate).No model, security, or test changes — the guard, its message, and its test already existed.
Test plan
-u disbursement_finance_kmitlso the view and translation reload.bills_posted, open it from the audit queue with เรื่องที่จ่าย empty, on an untouched form: each smart button opens instead of raising an "Invalid fields" toast; breadcrumb back to list works.UserError, state staysbills_posted.UserError, nothing advances.oca_run_testslimited todisbursement_finance_kmitlstays green.