[16.0][ADD] purchase_contract_revision_kmitl: replace PO change wizard - #1272
Open
PiyaChaiyanit wants to merge 3 commits into
Open
[16.0][ADD] purchase_contract_revision_kmitl: replace PO change wizard#1272PiyaChaiyanit wants to merge 3 commits into
PiyaChaiyanit wants to merge 3 commits into
Conversation
Redesign the PO amendment flow as first-class purchase.contract revision records: rev 0 auto-created at button_confirm, rev N user-initiated from "แก้ไขข้อมูลสัญญา". Each revision is a full snapshot (header + lines + งวด + committees) that syncs back to purchase.order.line / purchase.invoice.plan on apply while leaving the budget commitment untouched. Approval is gated on an attached external approval document (no in-system approval flow, ADR-0003); งวด with a disbursement.request are frozen (ADR-0002). Deletes the legacy purchase_order_change and purchase_order_change_committee modules — target DBs must uninstall them via Apps UI before deploy.
PiyaChaiyanit
force-pushed
the
po-contract-revision-redesign
branch
from
September 10, 2026 11:01
6927b02 to
a4fe02f
Compare
added 2 commits
September 11, 2026 12:44
… xmlid base.module_category_operations_purchase does not exist in Odoo 16 — the purchase security groups use base.module_category_inventory_purchase (defined in odoo/addons/purchase/security/purchase_security.xml).
…tton The smart button had name='object' which isn't a real method — it was a scaffold leftover. Removed the whole block; the purchase_id M2O in the main group already exposes the parent PO clearly.
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
Replaces the
purchase_order_change/purchase_order_change_committeewizard flow with a first-classpurchase.contractrevision model (N per PO). Rev 0 is snapshotted atbutton_confirmand applies immediately; Rev N is user-initiated from "แก้ไขข้อมูลสัญญา", edited in a 2-tab form (lines → งวด, case-3 locked gate), and applied only after ≥ 1 external-approval file is attached — there is deliberately no in-system approval flow (approval happens on paper, ADR-0003). Apply syncs back topurchase.order.line/purchase.invoice.planwhile leaving thebudget.commitmentuntouched; งวด with adisbursement.requestare frozen (ADR-0002). The legacy modules are deleted outright — target DBs must uninstall them from the Apps UI before deploy or Odoo will fail to boot.Test plan
purchase_order_change+purchase_order_change_committeefrom the dev DB via Apps UIpurchase_contract_revision_kmitland confirm migration backfills a rev 0 for every existing confirmed PO