Skip to content

[19.0][IMP] contract_line_successor: colour contract lines by lifecycle state - #1520

Open
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-imp-contract_line_successor-state-colors
Open

[19.0][IMP] contract_line_successor: colour contract lines by lifecycle state#1520
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-imp-contract_line_successor-state-colors

Conversation

@bosd

@bosd bosd commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Depends on #1370 (the 19.0 migration of contract_line_successor, which introduces the line state field). Merge #1370 first; this then rebases to just the coloring change.

Problem

The contract-lines list colours a line blue whenever it is due for invoicing (create_invoice_visibility) and muted only when canceled. So an ordinary in-progress line shows up blue the moment it is invoice-ready, and an ended line looks identical to a running one. This applies both to the standalone contract-lines list and to the lists embedded on the contract form.

Change

Colour the lines by their lifecycle state, matching the contract list and Odoo's own draft/expired conventions, on both the standalone list and the contract-form embedded lists (contract_line_fixed_ids / contract_line_ids):

state colour
upcoming info (blue, like a draft order)
in-progress normal
to-renew, upcoming-close primary (purple: needs attention, but not an error)
closed, canceled muted

Warning/orange is deliberately left free so it keeps meaning a genuine problem (as has_invoice_generation_error does on the contract itself).

Note

This intentionally replaces the previous create_invoice_visibility-driven blue: an in-progress line that is due for invoicing is no longer coloured (blue now means upcoming only). Flagging that as a deliberate behaviour change for reviewers.

@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_line_successor Module contract_line_successor labels Sep 5, 2026
@bosd
bosd force-pushed the 19.0-imp-contract_line_successor-state-colors branch 2 times, most recently from efc3c38 to 6fff528 Compare September 5, 2026 16:10
bosd pushed a commit to bosd/contract that referenced this pull request Sep 5, 2026
The form's embedded recurring-line lists (contract_line_fixed_ids and
contract_line_ids) still coloured lines blue by create_invoice_visibility, so an
in-progress line lit up as soon as it was invoice-ready. Colour them by state to
match the standalone list / OCA OCA#1520: upcoming=info(blue), in-progress=normal,
to-renew/upcoming-close=primary(purple), closed/canceled=muted. Bump 1.1.8->1.1.9.
Colour the contract line list by the line's `state`:

- upcoming    -> info (blue, like a draft order)
- in-progress -> normal
- to-renew / upcoming-close -> primary (purple: needs attention before the end
  date, but not an error)
- closed / canceled -> muted

Warning (orange) is deliberately left free so it keeps meaning a genuine problem,
matching the contract itself (yellow = invoice generation error). This mirrors
the contract list colours and Odoo's draft/expired conventions, so a line's
status is readable at a glance. Replaces the previous
`create_invoice_visibility`-driven blue, which lit in-progress lines that
happened to be due for invoicing.
@bosd
bosd force-pushed the 19.0-imp-contract_line_successor-state-colors branch from 6fff528 to 9d9214a Compare September 5, 2026 18:26
bosd pushed a commit to bosd/contract that referenced this pull request Sep 5, 2026
…, bump 1.1.2

FLC deploy branch = OCA#1520 (standalone + contract-form line state colouring) with
a version bump so OPaaS upgrades past the deployed 1.1.0/1.1.1. The form colouring
lives here (not in base contract) because this module defines contract.line.state
and loads after contract.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:contract_line_successor Module contract_line_successor series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants