[16.0][IMP] agx_sarabun: add allow_manual flag and constraint on document type - #1182
Open
n3n wants to merge 2 commits into
Open
[16.0][IMP] agx_sarabun: add allow_manual flag and constraint on document type#1182n3n wants to merge 2 commits into
n3n wants to merge 2 commits into
Conversation
n3n
force-pushed
the
16.0-imp-agx_sarabun-doc-type-manual-create
branch
2 times, most recently
from
August 22, 2026 15:10
21e2350 to
73312c6
Compare
…type Add `allow_manual` (stored computed, overridable) to `sarabun.document.type` that defaults False for `from_record` kinds and True for `memo`/`circular`. Gate the manual-create type dropdown on this flag and enforce it server-side via `_check_manual_creation_allowed` so origin-less from_record หนังสือ are refused even through RPC/import. Fix test helper default type to memo (safe for origin-less calls) and add coverage for the new field and constraint.
n3n
force-pushed
the
16.0-imp-agx_sarabun-doc-type-manual-create
branch
from
September 7, 2026 15:29
73312c6 to
c0b1afd
Compare
A หนังสือ whose type is not manual-creatable (`allow_manual=False`) is spawned with its classification and must keep it, so make ประเภทเอกสาร read-only on the form once such a type is set. Adds `type_allow_manual` (related to `type_id.allow_manual`) to back the readonly attrs; the `type_id != False` guard keeps the field editable on a new record, where the required type has yet to be picked.
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
allow_manual(stored computed, admin-overridable Boolean) tosarabun.document.type— defaultsFalseforfrom_recordkinds,Trueformemo/circulardomainontype_id) so only manual-creatable types appear when composing by hand_check_manual_creation_allowedthat rejects origin-less หนังสือ whose type hasallow_manual=False, closing RPC/import back doorsfrom_record→memo(safe for origin-less calls) and exposedoc_type_from_recordfor tests that need it; add 5 new tests covering the field and constraint16.0.5.0.0→16.0.6.0.0Test plan
oca_run_testsonagx_sarabun,agx_sarabun_reset,agx_sarabun_todoallow_manualcolumn visible in Document Types tree/formfrom_recordtypes are hidden from the manual-create type dropdown on the หนังสือ form