[18.0][FIX] document_page: do not copy history on page duplicate - #633
Open
miquelrosell99 wants to merge 1 commit into
Open
[18.0][FIX] document_page: do not copy history on page duplicate#633miquelrosell99 wants to merge 1 commit into
miquelrosell99 wants to merge 1 commit into
Conversation
miquelrosell99
force-pushed
the
18.0-fix-document-page-copy-history
branch
from
July 31, 2026 09:31
75e0748 to
95bddc8
Compare
When duplicating a document.page, the One2many history_ids field was being copied by default, so the new page inherited all past revisions including their current state. Add copy=False on document.page.history_ids so duplicates start with a clean history. Add copy=False on the approval-specific fields of document.page.history (state, approved_date, approved_uid) so a duplicated change request resets to draft and does not inherit approval metadata. In document_page_approval, override copy() so the duplicated page starts with a single draft change request containing the original content, rather than reusing copied histories or auto-advancing to 'to approve'. Add tests covering both behaviors.
miquelrosell99
force-pushed
the
18.0-fix-document-page-copy-history
branch
from
July 31, 2026 09:54
95bddc8 to
7352bc5
Compare
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.
When duplicating a
document.page, the One2manyhistory_idsfield was being copied by default, so the new page inherited all past revisions including their current state.This PR adds
copy=Falseon:document.page.history_idsso duplicates start with a clean history.document.page.historyapproval fields (state,approved_date,approved_uid) so a duplicated change request resets to draft and does not inherit approval metadata.Tests are included for both behaviors.