[16.0][ADD] purchase_request_requisition_alternative: keep the request link on RFQ alternatives - #3147
Open
marcos-mendez wants to merge 3 commits into
Conversation
…lines Purchase request lines are ordered by id desc, so the last line typed shows up first and the order cannot be changed. Sale orders, purchase orders and invoices all carry a sequence field with a drag handle instead. Adds that sequence, plus a computed # column showing the position of each line. The position is not stored: it is a reading aid, and removing a line renumbers the ones below it.
An RFQ born from a purchase request loses the link when it gains an alternative: the alternative carries no trace of the request, and the request keeps reporting only the quantity of the original RFQ. Links the request lines to the alternatives too, on both paths -- creating an alternative from an RFQ, and attaching an existing one. Lines are paired by product, since linking a request line to alternative lines of other products would inflate the quantity it believes has been purchased.
marcos-mendez
force-pushed
the
16.0-add-purchase_request_requisition_alternative
branch
from
August 13, 2026 19:06
cf7fdeb to
8bc3e00
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.
Odoo puts several RFQs in competition as alternatives;
purchase_requestkeeps on each request line the purchase order lines the need ended up on, and
derives the purchased quantity from them. The two do not know about each
other.
So an RFQ born from a purchase request loses the trail as soon as it gains an
alternative: the alternative carries no reference to the request, and the
request keeps reporting only the quantity of the original RFQ.
This links the request lines to the alternatives as well, on both paths —
creating an alternative from an RFQ, and attaching an existing one.
Lines are paired by product. Linking a request line to alternative lines of
other products would inflate the quantity it believes has been purchased,
which is why the naive "link everything" approach is not used.
auto_installis on, since the module only makes sense when both bases arepresent. 7 tests, 100% coverage on both models, including a regression test
for writing on several orders at once.