Repository navigation
[18.0][FIX] product_contract: search contract lines by name - #1597
Open
parabol123654 wants to merge 1 commit into
Open
parabol123654 wants to merge 1 commit into
parabol123654 wants to merge 1 commit into
Conversation
Contributor
|
Hi @sbejaoui, |
pedrobaeza
reviewed
Nov 12, 2026
| cls.contract_line = cls.contract.contract_line_ids[0] | ||
| cls.sale.order_line._compute_product_contract_data() | ||
|
|
||
| def test_contract_line_name_search(self): |
Member
There was a problem hiding this comment.
Don't add this test. It's testing ORM.
_rec_name = "display_name" on contract.line made _search_display_name() build a domain on display_name, which calls _search_display_name() again: name_search() on contract lines (many2one fields, search) never returned. The display name is computed in contract, so drop _rec_name and let the name search use the name of the line. Fixes OCA#1596 Assisted-by: Claude Opus 5.5
parabol123654
force-pushed
the
18.0-fix-product_contract-contract-line-name-search
branch
from
November 14, 2026 18:44
6c02da8 to
fd07287
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.
Fixes #1596.
product_contractsets_rec_name = "display_name"oncontract.line._search_display_name()searches the_rec_namefield, so it builds a domain ondisplay_name, and searchingdisplay_namecalls_search_display_name()again. As a result,name_search()on contract lines never returns. It is used when typing in a many2one field to a contract line (e.g. on sale order lines) or when searching lines by name.The display name is computed by
_compute_display_name()incontract, so the_rec_nameis not needed. The fix removes it, and the name search uses thenameof the line, as withcontractalone.Test:
test_contract_line_name_searchsearches the contract line of the test contract by a part of its name.The same line is on 19.0; I'll forward-port the fix once this one is merged.
Assisted-by: Claude Opus 5.5