diff options
| author | MaxLarue <mla@odoo.com> | 2019-08-23 13:26:24 +0000 |
|---|---|---|
| committer | Geoffroy Larue <gla@odoo.com> | 2019-09-18 12:05:19 +0000 |
| commit | 5c03820f87ca96fc4bf31b695372ec9af8d1ac1a (patch) | |
| tree | 08cedd31f1163c183e4a337fbc05c3c712e9c2ae | |
| parent | b3bc7af0eabac726a8e33b4dd8ca55f9c3014392 (diff) | |
[IMP] industry_fsm: change date displaying on kanban cards
This commit changes the display of dates on kanban cards. It is now conditional.
Depending on the date versus actual date we conditionally set the color.
Depending if the record are grouped by date, we format the date as a date or as a time.
If the task is an fsm task we show the planned date begin otherwise we display the deadline.
From which App | project | fsm |
-------------------------------------------------------------------------------
task.is_fsm | y | n | y | n |
-------------------------------------------------------------------------------
task.fsm_state == 'done' | y | n | y | n | y | n | y | n |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
display deadline | n | n | y | y | n | n | y | y |
-------------------------------------------------------------------------------
should it be colored? | n | y | y | y | n | y | y | y |
-------------------------------------------------------------------------------
display city ? | n | n | n | n | y | y | y | y |
extra case: in fsm, if the records are grouped by date, we display time only in red, if the task is late, taking the time into account.
Task-2047389 Closes #5388
| -rw-r--r-- | addons/project/views/project_views.xml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index a5794fe5ebe..c17e563f8d2 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -566,7 +566,7 @@ <br /> <t t-if="record.partner_id.value"> <span> - <field name="partner_id"/><t t-if="record.partner_city.value"> • <field name="partner_city" /></t> + <field name="partner_id"/> </span> </t> <t t-else="record.email_from.raw_value"><span><field name="email_from"/></span></t> @@ -603,10 +603,14 @@ <span style="font-weight:bold;" class="fa fa-fw mt4 fa-meh-o text-warning" t-if="record.rating_last_value.value == 5" title="Latest Rating: Not Satisfied" role="img" aria-label="Neutral face"/> <span style="font-weight:bold;" class="fa fa-fw mt4 fa-frown-o text-danger" t-if="record.rating_last_value.value == 1" title="Latest Rating: Higly Dissatisfied" role="img" aria-label="Sad face"/> </b> + <!-- formating of the date --> + <t t-set="date_format" t-value="'MM/DD/YY'" /> + <t t-set="date" t-value=""/> + <!-- color of the span --> <t t-if="record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().startOf('day')" t-set="deadline_class">oe_kanban_text_red</t> <t t-elif="record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().endOf('day')" t-set="deadline_class">text-warning font-weight-bold</t> - <t t-if="record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().startOf('day')" t-set="date" t-value="moment(record.date_deadline.raw_value.toISOString()).format('h:mm A')" /> - <t t-elif="record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().endOf('day')" t-set="date" t-value="moment(record.date_deadline.raw_value.toISOString()).format('h:mm A')" /> + <!-- Date value --> + <t t-if="record.date_deadline.raw_value" t-set="date" t-value="moment(record.date_deadline.raw_value.toISOString()).format(date_format)" /> <span name="date" t-attf-class="#{deadline_class || ''}"><t t-esc="date" /></span> </div> <div class="oe_kanban_bottom_right" t-if="!selection_mode"> |
