Skip to content

[19.0][FW] contract: ports and oca-port blacklist from 16.0/17.0/18.0 - #1542

Open
bosd wants to merge 3 commits into
OCA:19.0from
bosd:19.0-fw-contract
Open

bosd wants to merge 3 commits into
OCA:19.0from
bosd:19.0-fw-contract

Conversation

@bosd

@bosd bosd commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Completes the oca-port sweep of 19.0 against 16.0, 17.0 and 18.0. Companion to #1541, which covered every other addon.

Ports

  • [18.0][IMP] contract: Contract line total amount #1446 — _get_contract_line_total_value() on contract.line, with its tests. Authorship preserved. Conflicts were the imports and the insertion point only; adapted to 19.0 by using self.env._() instead of _().
  • [17.0][FIX] contract: remove label and add help to setting #1415 — the tooltip on the create new line at contract line renew setting. Landed in contract_line_successor, because that setting moved there when the successor code was split off. oca-port will keep reporting it under contract, which is why it is also in the blacklist with that explanation.

Blacklist

The sweep produced 27 candidates for contract. Two were real, both above. The other 25 would be re-proposed on every future run.

Each verdict was checked against the 19.0 code:

kind entries
already on 19.0, identically or by another route #1071/#1075, #1078, #1085, #1095, #1123, #1154/#1156, #1165, #1168/#1169, #1174/#1175, #1178/#1181, #1189/#1190, #1195, #1229, #1232, #1423, #1438, #1462, #1490, #1526
not needed / not applicable #1019, #1158
repo-wide, attributed to every module it touched #1201
already ported #1429 (in #1535), #1415 (here, in another module)

Two worth singling out:

**#1152 is listed with a pointer, not a flat rejection.
** The defect is real on 19.0 res_partner_view.xml still has invisible="customer_rank == 0", so contacts created outside Sales cannot reach their contracts and #1416 is the 18.0 fix for it, currently under review.
Port it once #1416 settles rather than duplicating a fix that is still being discussed.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @sbejaoui,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:19.0 mod:contract Module contract mod:contract_line_successor Module contract_line_successor labels Sep 26, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review.

Both ports check out — #1446's total-value method correctly adds discount and iterates period-by-period (fixes #1429's 3 issues), with tests covering the basic and edge cases. #1415 is a small, low-risk tooltip/help-text fix. Spot-checked the blacklist, including the two flagged edge cases (#1019, #1152) — reasoning is sound. All 6 checks are passing on the current commit.

Branch has conflicts with base that need resolving before merge, so flagging that as the blocker.

qgroulard and others added 3 commits September 30, 2026 15:21
Previous implementation had 3 problems:
* Discounts were not taken into account
* When combined with 'contract_variable_quantity', '_get_quantity_to_invoice()' returns 1 for fixed quantities
* When combined with 'contract_variable_quantity', it is wrong to assume that the quantity to invoice of one big period is equal to the quantity to invoice of the sum of smaller chunks.

Because of the two last problems, we are forced to iterate over each periods and sum the subtotals.

(cherry picked from commit b5ca4cd)
Ports the wording from OCA#1415, which replaced the bare label on this setting
with a help text. The setting moved out of `contract` and into this module
when the successor code was split off, so the change lands here rather than
where oca-port reports it.
The 16.0/17.0/18.0 sweep produced 27 candidates for this addon; one was a
genuine gap (OCA#1446, ported here) and one moved module (OCA#1415, ported into
contract_line_successor). The rest would be re-proposed on every future run
and re-investigated from scratch.

Record them where the tool reads them, with the reason attached.

Each verdict was checked against the 19.0 code rather than taken from the PR
title. OCA#1019 is the one worth noting: it is a clean cherry-pick, but it
merges `analytic_account_id` into `analytic_distribution` and that field no
longer exists on contract.line, so applying it would be meaningless.

real on 19.0 and OCA#1416 is the 18.0 fix for it, currently under review.
@bosd

bosd commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @cpemiguelhendrickfmallari-lgtm Conflicts are resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and functional review.

Code: both ports look faithful to the originals with correct 19.0 adaptations (self.env._()).

Functional: tested on runboat. The help text shows under "Create new line at contract line renew" and the setting saves correctly. Screenshot below.

LGTM.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants