[19.0][FIX] agreement_rebate: always return a Domain from _target_line_domain - #125
Open
gdgellatly wants to merge 1 commit into
Open
[19.0][FIX] agreement_rebate: always return a Domain from _target_line_domain#125gdgellatly wants to merge 1 commit into
gdgellatly wants to merge 1 commit into
Conversation
In 19.0 `_target_line_domain` returned a mix of types: a plain list in the common case, but a `Domain` object when the agreement had `rebate_line_ids`. Callers (and modules overriding this method) that treat the result as a list then break, e.g. `AttributeError: 'DomainAnd' object has no attribute 'append'`. Compose the domain natively with `Domain` and the `&` operator so the method consistently returns a `Domain`. Behaviour is unchanged: the extra leaves are still AND-ed together, and the `Domain` round-trips through the `target_domain` Char field via its list-style repr. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
|
Hi @gdgellatly I believe we are supposed to remove Cursor from the co-author in the commit based on the new OCA AI policy. |
max3903
approved these changes
Jul 29, 2026
Author
|
@max3903 i believe the policy said the exact opposite. hence I added bit back in. |
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.
Description
In 19.0,
AgreementSettlementCreateWiz._target_line_domainreturnsinconsistent types depending on the agreement:
listin the common case, butDomainobject when the agreement hasrebate_line_ids(viaDomain(domain) & line_domains).Any caller — or module overriding this method — that treats the result
as a list then breaks against a
Domain. In a downstream module thissurfaced as:
What this PR does
Composes the domain natively using
Domainand the&operator so themethod always returns a
Domain, which is the 19.0 idiom.Backward compatibility
Behaviour is unchanged:
invoice_datebounds, per-line/rebate_line_idsdomains) are still AND-ed together, matching the previous implicit
top-level AND of list concatenation.
Domain:_read_grouptakes aDomain, and thetarget_domainCharfield round-trips it throughits list-style
repr(already the case today for therebate_line_idsbranch).
Domainremains iterable to the old-style list, so any external codestill doing
list(...)keeps working.Made with Cursor