diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2019-11-25 14:05:01 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2019-11-28 16:57:04 +0000 |
| commit | 34aae9faa548f6a75075ad0cb91ea39e5ef9b06c (patch) | |
| tree | e06fa499ee1561e83a5cb25584372ea219f8d7a9 | |
| parent | 35eab823b0cb742dfd21ad15820410b56a8822bd (diff) | |
[FIX] web: typo calendar highlight -> ok now
Adapt calendar highlight option (that "highlight" event linked to the
record we come from) to current JS framework data structures.
note: this changeset also fixes the original `_compute_is_highlighted`
that was would trigger CacheMiss errors, and also adds back the CSS for
highlighting that was lost between 12.0 and 13.0 version.
opw-2131494
closes #40791
closes odoo/odoo#41077
X-original-commit: da56e3e7036ecdb3905f4152778e853e080e0163
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
| -rw-r--r-- | addons/calendar/models/calendar.py | 3 | ||||
| -rw-r--r-- | addons/calendar/views/calendar_views.xml | 1 | ||||
| -rw-r--r-- | addons/web/static/src/scss/web_calendar.scss | 9 | ||||
| -rw-r--r-- | addons/web/static/src/xml/web_calendar.xml | 2 |
4 files changed, 14 insertions, 1 deletions
diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index a284f90a4fa..b3b9124c677 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -757,6 +757,9 @@ class Meeting(models.Model): event.is_highlighted = True else: event.is_highlighted = False + else: + for event in self: + event.is_highlighted = False name = fields.Char('Meeting Subject', required=True, states={'done': [('readonly', True)]}) state = fields.Selection([('draft', 'Unconfirmed'), ('open', 'Confirmed')], string='Status', readonly=True, tracking=True, default='draft') diff --git a/addons/calendar/views/calendar_views.xml b/addons/calendar/views/calendar_views.xml index 085c212d651..552fe5c7a41 100644 --- a/addons/calendar/views/calendar_views.xml +++ b/addons/calendar/views/calendar_views.xml @@ -265,6 +265,7 @@ <field name="attendee_status"/> <field name="partner_id"/> <field name="partner_ids" widget="many2many_tags_avatar" write_model="calendar.contacts" write_field="partner_id" avatar_field="image_128"/> + <field name="is_highlighted" invisible="1"/> <field name="description"/> </calendar> </field> diff --git a/addons/web/static/src/scss/web_calendar.scss b/addons/web/static/src/scss/web_calendar.scss index 55fc4c1d9ab..3dfbea15df2 100644 --- a/addons/web/static/src/scss/web_calendar.scss +++ b/addons/web/static/src/scss/web_calendar.scss @@ -594,6 +594,15 @@ $o-cw-filter-avatar-size: 20px; .fc-event.o_calendar_color_#{$i} { border-color: $color; color: darken($color, 35%); + opacity: 0.8; + + &.o_event_hightlight { + opacity: 1; + + .fc-content { + font-weight: bold; + } + } .fc-bg { background: mix($color, white); diff --git a/addons/web/static/src/xml/web_calendar.xml b/addons/web/static/src/xml/web_calendar.xml index 50c00ab8b20..a4a4731b451 100644 --- a/addons/web/static/src/xml/web_calendar.xml +++ b/addons/web/static/src/xml/web_calendar.xml @@ -12,7 +12,7 @@ </div> <t t-name="calendar-box"> - <div t-att-style="typeof color === 'string' ? ('background-color:' + color) + ';' : ''" t-attf-class="#{!event.color_index ? 'text-white' : ''} #{record.is_highlighted and record.is_highlighted.value ? 'o_event_hightlight' : ''} #{typeof color === 'number' ? _.str.sprintf('o_calendar_color_%s', color) : ''}"> + <div t-att-style="typeof color === 'string' ? ('background-color:' + color) + ';' : ''" t-attf-class="#{!event.color_index ? 'text-white' : ''} #{record.is_highlighted ? 'o_event_hightlight' : ''} #{typeof color === 'number' ? _.str.sprintf('o_calendar_color_%s', color) : ''}"> <div class="o_event_title" t-esc="record.display_name"/> </div> </t> |
