diff options
| author | Romain Derie <rde@odoo.com> | 2020-02-03 16:05:48 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2020-02-04 13:06:08 +0000 |
| commit | 4eb2aeb8e7a9d004da83c9156926e42c8aebc6ef (patch) | |
| tree | a1ee2e21a6330666f08f37558cdf3ebd3e8e5ffb /addons/website_event | |
| parent | 8fc61fd2b49e70642a60260eb19ac3ea639582d0 (diff) | |
[IMP] website: make cover_properties a mixin field
Next commit will add new cover properties entries for the bg color.
Still, we want a default `bg-primary` class. Instead of addind 3 new default
value in existing cover_property fields, the chance is taken to make a mixin
out of that field to avoid code duplication.
task-2144335
Diffstat (limited to 'addons/website_event')
| -rw-r--r-- | addons/website_event/models/event_event.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/website_event/models/event_event.py b/addons/website_event/models/event_event.py index 85694acd063..6a8f1fd8eeb 100644 --- a/addons/website_event/models/event_event.py +++ b/addons/website_event/models/event_event.py @@ -19,7 +19,7 @@ class EventType(models.Model): class Event(models.Model): _name = 'event.event' - _inherit = ['event.event', 'website.seo.metadata', 'website.published.multi.mixin'] + _inherit = ['event.event', 'website.seo.metadata', 'website.published.multi.mixin', 'website.cover_properties.mixin'] # description subtitle = fields.Char('Event Subtitle', translate=True) @@ -27,9 +27,6 @@ class Event(models.Model): is_participating = fields.Boolean("Is Participating", compute="_compute_is_participating") # website website_published = fields.Boolean(tracking=True) - cover_properties = fields.Text( - 'Cover Properties', - default='{"background-image": "none", "opacity": "0.4", "resize_class": "o_half_screen_height"}') website_menu = fields.Boolean( 'Dedicated Menu', copy=False, help="Creates menus Introduction, Location and Register on the page " @@ -59,6 +56,11 @@ class Event(models.Model): if self.event_type_id: self.website_menu = self.event_type_id.website_menu + def _default_cover_properties(self): + res = super()._default_cover_properties() + res['opacity'] = '0.4' + return res + def _get_menu_entries(self): """ Method returning menu entries to display on the website view of the event, possibly depending on some options in inheriting modules. """ |
