Skip to content

[19.0][IMP] contract: label the date fields "Start Date" and "End Date" - #1515

Open
bosd wants to merge 2 commits into
OCA:19.0from
bosd:19.0-imp-contract-date-labels
Open

[19.0][IMP] contract: label the date fields "Start Date" and "End Date"#1515
bosd wants to merge 2 commits into
OCA:19.0from
bosd:19.0-imp-contract-date-labels

Conversation

@bosd

@bosd bosd commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Problem

date_start and date_end on contract.recurring.mixin carry no string, so Odoo derives the label from the field name. Every contract, contract line, contract template and contract template line form therefore reads "Date Start" and "Date End".

That is the wrong word order in English, and it is not what Odoo does with the same pair of fields where it defines them itself:

# fleet/models/fleet_vehicle_assignation_log.py
date_start = fields.Date(string="Start Date")
date_end = fields.Date(string="End Date")

# event/models/event_event.py
date_end = fields.Datetime(string='End Date', ...)

Change

Set string="Start Date" / string="End Date" on the mixin, so all four models that inherit it pick the labels up in one place.

Three spots spelled the old wording out by hand and are updated to match:

  • the Date End group-by filter on the contract search view
  • the Date Start column header in the contract PDF report
  • Contract Date Start in the contract reference mail template

Labels only - no behaviour change, no field renames, no view restructuring.


Second commit: the columns could not be hidden either

Beyond the wording, neither date could be controlled from the line lists:

  • date_end carried no optional attribute, so it sat outside Odoo's column selector and was always shown, with no way to switch it off.
  • date_start was column_invisible="True", so it was never shown and could not be switched on.

The recurring line list is the exception: date_start is required="1" there and stays outside the selector, since hiding a required column would leave no way to fill it in an editable list.

`date_start` and `date_end` on the recurring mixin carry no `string`, so
Odoo derives the label from the field name and every contract, contract
line, template and template line form reads "Date Start" / "Date End".

Odoo labels the same pair "Start Date" / "End Date" wherever it defines it
itself - `fleet.vehicle.assignation.log`, `event.event` - and that is the
natural word order in English. Set the strings on the mixin so all four
models pick them up, and fix the three places that spelled the old wording
out by hand: the group by filter on the contract search view, the line
table header in the PDF report and the contract reference block in the
mail template.

Labels only, no behaviour change.
The line lists showed End Date unconditionally and never showed Start Date
at all: `date_end` carried no `optional` attribute, so it was outside
Odoo's column selector and could not be switched off, while `date_start`
was `column_invisible="True"` and could not be switched on. Nothing in any
view referenced `date_start` in a modifier, so it was hidden outright
rather than kept for its value.

Put both under the column selector on the two line lists of the contract
form and the two contract line lists, with `optional` set so the default
columns stay exactly as they are today - End Date shown, Start Date hidden
where it already was.

The one exception is the recurring line list, where `date_start` is
`required="1"`. A required column stays outside the selector: hiding it
would leave no way to fill it in an editable list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants