Skip to content

[16.0][ADD] purchase_request_requisition_alternative: keep the request link on RFQ alternatives - #3147

Open
marcos-mendez wants to merge 3 commits into
OCA:16.0from
marcos-mendez:16.0-add-purchase_request_requisition_alternative
Open

[16.0][ADD] purchase_request_requisition_alternative: keep the request link on RFQ alternatives#3147
marcos-mendez wants to merge 3 commits into
OCA:16.0from
marcos-mendez:16.0-add-purchase_request_requisition_alternative

Conversation

@marcos-mendez

Copy link
Copy Markdown

Odoo puts several RFQs in competition as alternatives; purchase_request
keeps 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_install is on, since the module only makes sense when both bases are
present. 7 tests, 100% coverage on both models, including a regression test
for writing on several orders at once.

…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.
@OCA-git-bot OCA-git-bot added series:16.0 mod:purchase_request_line_sequence Module purchase_request_line_sequence mod:purchase_request_requisition_alternative Module purchase_request_requisition_alternative labels Aug 13, 2026
@marcos-mendez
marcos-mendez force-pushed the 16.0-add-purchase_request_requisition_alternative branch from cf7fdeb to 8bc3e00 Compare August 13, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:purchase_request_line_sequence Module purchase_request_line_sequence mod:purchase_request_requisition_alternative Module purchase_request_requisition_alternative series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants