[IDEA] Deprecate document.page.history and use base_revision
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The issue identifies document_page and base_revision but gives no files, tests, or implementation entry point. Start by reading both modules’ revision models and the history logic, then assess how inheritance and existing document data would be handled. Done means document.page uses base_revision and the old history model is removed, with revision tracking covering document context as well as content.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem?
- Document_page_history handles only changes in document content.
- In ISO (and most other certification schemes, I guess) changes in the context of the document (aka scope, use, applicability, responsibility) should also create a new version.
- Document history has been problematic working ON / OFF between Odoo versions
Describe the solution you'd like
Remove document.page.history completely and replace, inheriting from base_revision.
Using base_revision as the foundation for document revisions in the document_page module would simplify the architecture considerably while also making revision tracking more complete and consistent.
Today, document.page.history duplicates part of the data model and requires explicit logic to decide which fields are copied into history records. This creates several limitations:
- only selected fields are revisioned (content)
- schema changes must be mirrored manually
- custom modules adding fields are not automatically revision-aware
- history synchronization logic becomes harder to maintain
- revision consistency depends on custom implementation details
By refactoring document_page to inherit from base_revision, revisions would become model-native instead of relying on a parallel history model.
Key advantages of this approach:
- Automatic revisioning of all fields
Any stored field added by OCA or third-party modules automatically becomes part of the revision system without additional code. - Elimination of duplicated models
Removing document.page.history reduces maintenance burden and avoids keeping two partially synchronized representations of the same document. - Better extensibility for OCA ecosystem modules
Modules extending document.page would gain revision support automatically, including custom metadata, categorization, workflow fields, attachments, references, etc. - Consistent behavior with other OCA modules
base_revision already provides a standardized revision workflow used across the OCA, improving predictability and reducing custom code. - Reduced upgrade complexity
Future field additions or refactors would not require updating history-copying logic or migration scripts for duplicated fields. - Improved auditability
Since revisions are based on the actual business record structure, the revision history becomes more complete and reliable, thus you get a better point-in-time view of the documents. - Cleaner ORM integration
Access rights, computed fields, tracking behavior, and inheritance patterns remain centered on a single model architecture instead of a shadow history model. - Easier maintenance long-term
Less custom revision logic means fewer edge cases and lower risk of history inconsistencies (issues such as #565).
This refactoring would effectively shift the module from a “manual snapshot/history table” approach to a generic ORM-level revision mechanism, making the revision system both more powerful and easier to maintain.
Furthermore any logic that needs to be used for documents (such as summary of changes) can be added to base_revision so all modules that inherit from it can use it if it makes sense for them.
Describe alternatives you've considered
Duplicate all fields of document.page to document.page history and keep track of changes.
Additional context
This is just a use case investigation and I haven't reached deep in implementation details.
What do you think @etobella @pedrobaeza @victoralmau
- 主要语言
- HTML
- 星标
- 256
- 派生
- 405
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OCA/knowledge 的其他 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 94/100
维护者通常 1 天内回复
-
help wanted no stale work in progress
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 43/100
OCA/knowledge#616 · 8 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
Migration to version 19.0可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭help wanted no stale work in progress
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
Migration to version 18.0可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭help wanted no stale work in progress
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
milind-soni/OpenMausBot#5829 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
finos/fluxnova-bpm-platform#387 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
OHDSI/Data2Evidence#3693 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Project-N-E-K-O/N.E.K.O#3725 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
kubernetes-sigs/headlamp#8408 ·
维护者通常 1 天内回复