Draft and Publish
Work in progress
Overview
The Draft and Publish functionality allows users to create, modify, and finalize data entries before making them publicly available or integrating them into the main system. It ensures that users can work on data iteratively while maintaining control over visibility and approval workflows.
Key Features
Draft Mode:
Users can create new entries in a private workspace.
Drafts are accessible only to the creator until submitted for approval.
Auto-save or manual save options ensure no data loss during editing.
Approval Workflow:
Once ready, users can submit drafts for review.
Administrators or approvers verify and approve drafts before publishing.
Rejected drafts can be revised and resubmitted.
Publishing:
Approved drafts are finalized and stored in the main system.
Notifications keep users informed about the approval and publishing status.
Unique ID is created and assigned
Audit Trail:
Tracks all changes, approvals, and publishing actions with timestamps and user details.
Access Control:
Only the creator can edit drafts in progress.
Approvers have visibility of submitted drafts.
Benefits
Improved Data Accuracy:
Enables users to iteratively refine data before submission, reducing errors.
Enhanced Collaboration:
Structured approval workflows ensure high-quality data with accountability.
Controlled Data Publishing:
Only approved entries are published, ensuring consistency in the main database.
Better User Experience:
Users can work on drafts at their own pace without immediate publishing pressure.
Secure and Private Editing:
Access controls limit visibility to authorized personnel only.
Auditability:
Comprehensive logs improve transparency and help with compliance.
Workflow: Draft and Publish Process
Start: Initiate Draft
A user starts by creating a new draft record for the entity (e.g., a Registrant).
The draft is stored in a temporary workspace specific to the user.
Modify Draft
The user updates and modifies the draft as needed.
Changes are auto-saved or manually saved in the temporary workspace.
Review Draft
The user reviews the draft to ensure all required information is complete and accurate.
The status of the draft remains as "In Progress" during this stage.
Submit for Approval
Once the user is satisfied with the draft, they submit it for approval.
The status of the draft changes to "Submitted."
Notifications are sent to administrators or approvers.
Approval Process
The administrator or approver reviews the submitted draft.
If the draft meets the required standards, it is approved.
If the draft requires changes, it is sent back to the user with comments, and the status reverts to "In Progress."
Publish Draft
Once the draft is approved:
The draft data is finalized and stored in the main database (e.g.,
res.partner
).The status of the draft changes to "Published."
Notifications are sent to the user confirming the publication.
End: Finalized Data
The approved and published data becomes part of the main records, visible and usable by the system.
Low level design
Entities and Models
res.partner
(Main Model for Registrant)Purpose: Stores finalized and published data for registrants.
Key Fields:
name
(Char): Name of the registrant.email
(Char): Email address.phone
(Char): Contact number.Additional fields extended by the
registrant
model.
registrant
(Extension ofres.partner
)Purpose: Adds specific fields for registrants.
Transient Draft Model
Purpose: Holds draft data during editing.
Structure:
Inherits from
res.partner
.Temporary, non-persistent storage.
Draft Metadata Table
Purpose: Tracks draft records and metadata.
Key Fields:
user_id
(Many2one): Links to the user creating/editing the draft.last_modified
(Datetime): Timestamp of the last edit.status
(Selection): Draft, Submitted, or Published.data
(JSON): Stores serialized draft data.
Workflows
Draft Creation
User initiates a new draft.
A new record is created in the transient model.
Initial metadata entry is added to the draft metadata table.
Draft Modification
User edits the draft record via a form view.
Changes are saved in the transient model.
last_modified
timestamp in metadata is updated.
Draft Submission
User submits the draft for approval.
Metadata
status
changes to "Submitted."Draft becomes visible to the approver.
Approval Workflow
Approver reviews the draft.
If Approved: Metadata
status
changes to "Published."If Rejected: Metadata
status
changes back to "Draft," and the user is notified.
Publishing
Approved draft data is transferred to
res.partner
.A unique id is generated.
Draft data in transient model and metadata table are archived.
Access Control
Draft Visibility
User: Can only view and edit their own drafts.
Approver: Can view submitted drafts.
Approval Rights
Only users with the "Approver" role can approve or reject drafts.
States
Draft
The initial state of a new or in-progress draft created by the user.
Submitted
The draft has been completed by the user and submitted for review.
Approved
The draft has been reviewed and approved by the approver.
Rejected
The approver has reviewed the draft and decided it needs revisions.
Published
The approved draft has been published as a registrant record in
res.partner
.
State Transitions Overview
Last updated