[19.0][IMP] contract: label the date fields "Start Date" and "End Date" - #1515
Open
bosd wants to merge 2 commits into
Open
[19.0][IMP] contract: label the date fields "Start Date" and "End Date"#1515bosd wants to merge 2 commits into
bosd wants to merge 2 commits into
Conversation
`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.
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.
Problem
date_startanddate_endoncontract.recurring.mixincarry nostring, 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:
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:
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_endcarried nooptionalattribute, so it sat outside Odoo's column selector and was always shown, with no way to switch it off.date_startwascolumn_invisible="True", so it was never shown and could not be switched on.The recurring line list is the exception:
date_startisrequired="1"there and stays outside the selector, since hiding a required column would leave no way to fill it in an editable list.