From 47b0c0d2d4ade8f0aeb3274327c9aecd99675c9a Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Tue, 25 Feb 2020 12:58:11 +0000 Subject: [PATCH] [IMP] web,calendar: display attendance status widget in calendar popover before this commit, widgets which has specialData attribute e.g.many2manyattendee were not supported in calendar popover, as widgets with specialData attribute are meant to be supported in form view. after this commit, widgets with specialData attribute can be added in calendar popover, specialData method is called explicitly from calendar_popover to fetch special data required to render such widgets. with this commit we also did miscellaneous improvement in many2manyattendee - many2many_attendee status widget bullet not aligned with attendee name, with this commit bullet is aligned with attendee name. - if many2many_attendee does not have status value then do not display status else blank space is displayed before attendee name. - in community tentative status color in many2many attendee tags widget has o-brand-secondary color which is almost light grey, so due to badge light grey color and tentative status light grey color status is not displayed. To fix this issue, set tentative status color to simple grey which is bit dark then badge background color. task-2058767 closes odoo/odoo#46396 Signed-off-by: Aaron Bohy (aab) --- .../calendar/static/src/js/base_calendar.js | 4 +- addons/calendar/static/src/scss/calendar.scss | 5 +- .../calendar/static/src/xml/base_calendar.xml | 5 +- .../calendar/static/tests/calendar_tests.js | 14 ++++-- addons/calendar/views/calendar_views.xml | 2 +- .../src/js/views/calendar/calendar_popover.js | 30 +++++++++++- .../web/static/tests/views/calendar_tests.js | 46 +++++++++++++++++++ 7 files changed, 95 insertions(+), 11 deletions(-) diff --git a/addons/calendar/static/src/js/base_calendar.js b/addons/calendar/static/src/js/base_calendar.js index f2c1e56b298..46362327e17 100644 --- a/addons/calendar/static/src/js/base_calendar.js +++ b/addons/calendar/static/src/js/base_calendar.js @@ -8,7 +8,7 @@ var relationalFields = require('web.relational_fields'); var session = require('web.session'); var WebClient = require('web.WebClient'); -var FieldMany2ManyTags = relationalFields.FieldMany2ManyTags; +const FieldMany2ManyTagsAvatar = relationalFields.FieldMany2ManyTagsAvatar; var CalendarNotification = Notification.extend({ template: "CalendarNotification", @@ -137,7 +137,7 @@ BasicModel.include({ }, }); -var Many2ManyAttendee = FieldMany2ManyTags.extend({ +const Many2ManyAttendee = FieldMany2ManyTagsAvatar.extend({ // as this widget is model dependant (rpc on res.partner), use it in another // context probably won't work // supportedFieldTypes: ['many2many'], diff --git a/addons/calendar/static/src/scss/calendar.scss b/addons/calendar/static/src/scss/calendar.scss index 7e98c95d0ae..4260c9bad73 100644 --- a/addons/calendar/static/src/scss/calendar.scss +++ b/addons/calendar/static/src/scss/calendar.scss @@ -3,13 +3,14 @@ width: 10px; height: 10px; border-radius: 5px; + vertical-align: middle; &.accepted { background-color: theme-color('success'); } - &.needsAction { - background-color: $o-brand-secondary; + &.tentative { + background-color: $o-main-color-muted; } &.declined { diff --git a/addons/calendar/static/src/xml/base_calendar.xml b/addons/calendar/static/src/xml/base_calendar.xml index 8ecdd17b5fd..f2f30f361f6 100644 --- a/addons/calendar/static/src/xml/base_calendar.xml +++ b/addons/calendar/static/src/xml/base_calendar.xml @@ -1,8 +1,9 @@