[18.0][IMP] hr_shift: use employee name instead of weekday in line display_… - #47
Open
cvinh wants to merge 1 commit into
Open
Conversation
…name
hr.shift.planning.line._compute_display_name currently produces
'{weekday} - {template or state}'. That format is redundant in every
place the display_name is actually shown to end users:
- On the calendar view, the weekday is the column position, so
writing it inside the block label just repeats what the grid
already conveys.
- On the list and form views, day_number is a dedicated field
already rendered as its own column or field, so the weekday
appears twice on the same row.
Meanwhile the field the display_name lacks is the employee, which
makes the identity of a line indistinguishable from another line
of the same planning on the same weekday (two employees sharing
'Wednesday - Morning' get the exact same display_name, so any
breadcrumb, popover title, chatter mention or mail template that
relies on display_name cannot tell them apart).
Replace the weekday by the employee's name in the format expression
and update @api.depends accordingly. day_number remains fully
available through its own field wherever it is needed (calendar
column, list column, form field). The employee full name is used
as-is, without truncation, consistent with how it appears in every
other HR view.
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.
…name
hr.shift.planning.line._compute_display_name currently produces '{weekday} - {template or state}'. That format is redundant in every place the display_name is actually shown to end users:
Meanwhile the field the display_name lacks is the employee, which makes the identity of a line indistinguishable from another line of the same planning on the same weekday (two employees sharing 'Wednesday - Morning' get the exact same display_name, so any breadcrumb, popover title, chatter mention or mail template that relies on display_name cannot tell them apart).
Replace the weekday by the employee's name in the format expression and update @api.depends accordingly. day_number remains fully available through its own field wherever it is needed (calendar column, list column, form field). The employee full name is used as-is, without truncation, consistent with how it appears in every other HR view.