Skip to content

fix: prevent modifications to transmitted edocuments#36

Merged
pritambiswal merged 3 commits intoprilk-consulting:developfrom
maasanto:fix-protect-transmitted-edocuments
Feb 13, 2026
Merged

fix: prevent modifications to transmitted edocuments#36
pritambiswal merged 3 commits intoprilk-consulting:developfrom
maasanto:fix-protect-transmitted-edocuments

Conversation

@maasanto
Copy link

@maasanto maasanto commented Feb 12, 2026

Once an EDocument reaches a terminal state (Transmission Successful, Transmission Failed, Matching Successful, Matching Failed), it should be treated as immutable.

Without this fix, before_save re-runs XML validation on every save, which resets the status back to Validation Successful — re-enabling the Send button on an already-transmitted document. Additionally, the status field was editable by users, allowing manual overrides of system-managed state.

Changes

Server-side (edocument.py):

  • generate_xml() and validate_xml() now throw if status is Transmission Successful
  • before_save skips automatic re-validation for documents in terminal statuses

Client-side (edocument.js):

  • Hides "Generate XML" and "Validate XML" buttons for transmitted documents

DocType definition (edocument.json):

  • status field is now read_only — it is entirely system-managed (set by validation, matching, and transmission logic), so users should not be able to manually override it

@maasanto maasanto marked this pull request as ready for review February 13, 2026 08:46
@pritambiswal pritambiswal merged commit 4026a6f into prilk-consulting:develop Feb 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants