Commit Graph
137 Commits
Author SHA1 Message Date
Nikunj Ladava 4430b1d958 [IMP] website_event: add 'All events' topbar filter
We don't have any option to see to see all the events currently. However
this option can be useful sometimes. For example you are looking for an
event but don't know whether it's already finished or upcoming. Or if you
are looking if some event "types" are available (e.g.: Do they sometimes
organize Tennis competitions ?).

In this commit a new filter is added in the last 'All events' which allows
users to see all the events.

Task-2581308

Part-of: odoo/odoo#75066
2021-09-24 11:08:35 +00:00
Benoit Socias 9f9c4bb7e4 [IMP] website(_*): replace search callbacks by a mixin
Before this commit the `_search_get_detail` result contained callback
functions to handle special behavior during fetching and rendering.

After this commit a `website.searchable.mixin` is introduced that must
be inherited by models that participate in website-based searches.
Custom behavior previously achieved with callbacks is now achieved by
overloading methods of this mixin.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Benoit Socias 7559626c54 [IMP] website, *: make a generic search bar snippet available
(*: website_blog, website_event, website_forum, website_sale,
website_slides)

Before this commit the search bar was specific to products.

After this commit a generic search bar is available as a general feature
of website which can be configured to inspect specific models.
The snippet is used to replace the old search bar in blog, courses,
event, forum, page and shop.
The search results of these pages and the autocomplete of the search bar
run through the same search mechanism.
A new hybrid results page has also been created as a target of a search
on "Everything".

In each involved module, `website._search_get_details()` is implemented
to return search metadata for every model related to the `search_type`
parameter.
Search metadata for a single model is returned by `_search_get_detail()`
on that specific model.

The autocomplete runs through the additional
`website._search_render_results()` pre-rendering step that prepares the
data to fit in the autocomplete template.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
qmo-odoo 344f180ebb [IMP] website_event: improve default cover properties on /register
The purpose of this commit is to change the default values of an event cover
image to improve the UX, especially while using the editor.

Task-2488019
PR odoo/odoo#68901
2021-08-23 14:59:00 +00:00
Aurélien Warnon 1b66782dca [REF] event_*: refactor the event foldable registration badge
PURPOSE

The event foldable badge is currently not very user-friendly in terms of usage
and style.
This commit aims to re-work it visually as well as getting rid of multiple
technical flows (unnecessary fields / no studio anchors / ...).

SPECS

Preliminary cleaning : Unify both foldable badge templates into one.

The "event badges" report can be printed from 2 different sources, from the
event.event itself as a preview and from the event.registration as an actual
badge for a specific attendee.

The implementation was done using two different templates, leading to a lot of
duplicated code and potential issues when editing one template that would not
modify the other accordingly.

This commit unifies both templates into one.
When the report is printed from the event as a "preview", we simply check that
the attendee variable is missing and print placeholders instead.

Main changes : Rework the whole foldable badge template

1. Get rid of unnecessary fields

The foldable badge template used several fields on the event.event model itself
that would allow customizing the report per event.
However, there were actually no way for the user to access and edit those
fields, as they are not part of any views.

We therefore removed them (badge_front, badge_back, badge_innerleft,
badge_innerright, event_logo).

And instead offer a single new field (ticket_extra_instructions), available on
the form view of the event, that allows to easily customize the foldable badge
and adding instructions specific to this event (how to come / what to bring /
...).

2. Visual changes

The report was re-worked to make it look a bit more recent, as the previous
look was very basic and was not very attractive.

This was done using a specific scss file that allows defining rules without
bloating the template with long style attributes.

In addition, we added some pictures that help the attendee understanding how to
correctly fold the printed A4 sheet into a badge and slide it into the holder.

All the information that were previously on the report should still be there.

3. Relocate action from website_event to event

As a bonus, we moved the reporting action from website_event to event, in order
to have everything that is related to this foldable badge in the same module.

Side note: scss disclaimer

As the reporting engine does not allow complex class/rules building, we had to
implement this nice layout using very well placed background-image and
"pixel perfect" sized elements.

You will see a lot of hardcoded numbers, mainly on heights, but it can't be
helped.

LINKS

ENT PR odoo/enterprise#19349
UPG PR odoo/upgrade#2599
Task-26779
2021-07-30 09:02:52 +00:00
Thibault Delavallée 242ffe2f24 [IMP] website_event_*: simplify menu definition code
Now that all menus are managed the same way using a menu type and
clear definitions we can set all menu type definitions to override
_get_website_menu_entries. This is just some code cleaning and
has no functional impact.

Task-2577079
PR odoo#72411
2021-07-07 08:27:54 +00:00
Thibault Delavallée cc9933256a [IMP] website_event: create website menu for all events menus
In website_event some event-specific frontend menus are not linked to
``website.event.menu`` like track or exhibitor sub-modules menus. This
comes from initial implementation of ``website.event.menu`` that was
available only for ``website_event_track``.

Using ``website.event.menu`` eases menu management as it allows to have
an object making a link between the event and the website menu. Notably
when checking / unchecking in backend submenus it eases management.
It also eases management when people manually edit menus from frontend
as otherwise we have to manually manage ``ir.ui.view`` based on some
naming manipulation.

Task ID-2577079
See odoo/odoo#72411
2021-07-07 08:27:54 +00:00
Sébastien Mottet (oms) cd3ca50548 [IMP] website: change CTA based on website main objective
If user selects 'schedule appointments' as main objective in the configurator
and if the website_calendar module is installed then the Call To Action of
snippets s_banner, s_cover and s_call_to_action is changed to 'Schedule an
appointment' and redirect user to '/calendar' on click.

task-2518565

closes odoo/odoo#71162

Related: odoo/enterprise#18690
Related: odoo/design-themes#5
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-02 09:32:56 +00:00
Noe Antoine 94e4756343 [IMP] website_event: rename extra register button.
BEFORE THIS COMMIT

The option adding an extra register button in top right
(at submenu height) of an event website page was presented as a
checkbox 'Register Button' on event form and 'Add Register Button'
on event type form.This was easily mistaken as the option of
allowing / preventing user registrations, which is not the case at all.

AFTER THIS COMMIT

In both event.event and event.type, this option is renamed
'Extra Register Button' to clarify its purpose and prevent such
a confusion.

--- Links ---
Task Id - 2578891
COM PR - odoo/odoo#72686

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-24 10:59:28 +00:00
std-odoo e0c2a8a2cc [IMP] event_*: clean ACL and add a new group "Registration Desk"
Purpose
=======

Clean the ACLs related to the Event application.

Add a new group to manage the registration in the entrance of an event. This
group should not be able to modify or remove records in Event but should be
able to create and manage the registrations.

Specifications
==============

Now, there are 3 event groups

  * ``Registration Desk User``, who can manage the registrations and
    read all event-related information;
  * ``Event User`` who can create event, sponsor, ticket... His role is
    to globally handle events on a day-to-day basis;
  * ``Event Administrator`` who can create event type, sponsor type,
    ticket type... His role is to manage the way events are managed withint
    its company:

Each group implies all previous groups.

Compared to previous event users gain a lot of rules, allowing to update
records like tickets, registrations, ... Low-end event users should now
use the registration desk group.

Links
=====

Task ID-2204364
COM odoo/odoo#57022
ENT odoo/enterprise#13984
UPG odoo/upgrade#1897
2021-04-02 13:40:50 +00:00
Thibault Francois 30ee35498b [FIX] website_event: make allowed_field customizable
Problem
-------
Since
https://github.com/odoo/odoo/commit/d3b18979bfb5496fa4370fdf03a806c469127730,
when a visitor register for an event, the fields in the POST are checked against a list of allowed fields.

The list is hardcoded inside the method _process_attendees_form.

Solution
--------
Move this list in a specific method that can be easily overidden by
another module

closes odoo/odoo#67080

X-original-commit: ebadf16c7c38ca52ec4c5ce871c2584aaa98b91d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Thibault Francois <tfr-odoo@users.noreply.github.com>
2021-03-02 15:12:18 +00:00
nounoubensebia 87f86579a1 [FIX] website_event: hide registered badge when registration is canceled
Before this commit, a participating badge was displayed on the event even if
the user's registration has been canceled. This is a strange behavior.

After this commit, the participating badge will be hidden if all the user's
registration have been canceled.

Task ID-2432546

closes odoo/odoo#65702

X-original-commit: 125e5401123d8e4bc7656ac7534cc9290451adbc
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-08 11:05:41 +00:00
dht-odoo 7087a168b7 [IMP] website_event[_track]: allow to show/hide tag categories on website
In backend, we may want to use tags for advanced use cases like reporting,
filtering, aggregating in spreadsheet, ... However right now we cannot
define tag categories dedicated for 'internal use only'.

Similar to eLearning, this commit introduces facility to decide whether or
not to show the tag categories on the website. It is based on website.published
mixin. is_published field will be used for taht purpose. ACLs are updated
accordingly. If the category is hidden from the website then it is used for
internal purpose only.

In order to make all the events menu together, this commit moves the
'Event Tags Categories' menu after 'Event Stages'.

COM PR odoo/odoo#63485
UPG PR odoo/upgrade#2088
Task Id-2300230

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-01 14:54:52 +00:00
Victor Feyens 8016591353 [IMP] event(_*): support batch creation
See merge commit for more details.

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:19:04 +00:00
Thibault Delavallée 147cf5f328 [FIX] website_event(_exhibitor/track_quiz): display community menu only when used
Community menu field is added in website_event module. It is used in two
inheriting modules, website_event_meet and website_event_track_quiz. There
is no other common ancestor for those two modules.

In website_event, community menu field should be False and not displayed
as it has no real use. Only in those sub-applications it should be
computed like other menu fields, and displayed in event views (both
event and event type for configuration).

PR #56340
2020-08-24 10:20:12 +00:00
Thibault Delavallée d544587195 [FIX] website_event_track(_online): fix track menu computation
This commit fixes glitches when switching menus. Indeed agenda is not correctly
taken into account, meaning it could get duplicated. Moreover track was
constantly coming back as True event when not wanted.

Behavior is: when setting website menu, force it to True, otherwise let users
defined its value. Agenda is part of track menu so fix its declaration in
_track and _track_online methods.

Task ID-2314778 (event online fixes)
PR #56340
PR odoo/enterprise#12589

X-Original-PR #56254
X-Original-Commit odoo/odoo@5821758c4d
2020-08-24 10:20:12 +00:00
Thibault Delavallée 4bbb36bd7f [IMP] (website_)event: ease configuration of Online features
PURPOSE

Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95b and odoo/enterprise@1472202

Also clean website event menu not being available in website event but only
in website event track, which implies some extra-code to manage it.

In short: merge website_event_online in website_event, website_event_track
_(online/session) in website_event_track.

RATIONALE

_online modules have been added to extend content of website_event and
website_event_track without having any impact on those module. First step
of cleaning is to move this content directly in base module.

track_session module is mainly a rewrite of track module. Second step of
cleaning is to move its content directly in website_event_track.

SPECIFICATIONS

Allow to configure Menu CTA button on event from event_type, like other
frontend related menus and buttons.

Add settings to ease discovering and installing sub event features like
  * meet;
  * exhibitor;
  * live mode;
  * quizzes;

LINKS

Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
2020-08-21 17:30:13 +00:00
Thibault Delavallée b0845c0f2b [REM] website_event_online: merge into website_event
PURPOSE

Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae

Also clean website event menu not being available in website event but only
in website event track, which implies some extra-code to manage it.

In short: merge website_event_online in website_event, website_event_track
_(online/session) in website_event_track.

RATIONALE

_online modules have been added to extend content of website_event and
website_event_track without having any impact on those module. First step
of cleaning is to move this content directly in base module.

track_session module is mainly a rewrite of track module. Second step of
cleaning is to move its content directly in website_event_track.

SPECIFICATIONS

Move remaining content of website event online to website event.

Update dependencies accordingly.

LINKS

Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
2020-08-21 17:30:13 +00:00
Thibault Delavallée 77d7a3cf6a [MOV] website_event(_track): move website event menu into website event
PURPOSE

Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae

Also clean website event menu not being available in website event but only
in website event track, which implies some extra-code to manage it.

In short: merge website_event_online in website_event, website_event_track
_(online/session) in website_event_track.

RATIONALE

_online modules have been added to extend content of website_event and
website_event_track without having any impact on those module. First step
of cleaning is to move this content directly in base module.

track_session module is mainly a rewrite of track module. Second step of
cleaning is to move its content directly in website_event_track.

SPECIFICATIONS

Move website event menu model directly into website event. Website event menu
model has been introduced to help dealing with event-specific menus and
website menus. This is some kind of glue to synchronize both of them as people
could either

  * update an event (website_menu, website_track) that updates website menus
    availability;
  * update menus through website that should update event field value and menu
    computation;

Having a model introduced in website event track forces to have override and
code split across website_event, website_event_track, and now also in both
_online version of those two as menu management was improved.

In this commit we simplify all this code by moving most of menu management
code in website_event, leaving only business-specific code (fields and their
menus) to sub modules.

SPECIFICATIONS: WEBSITE EVENT MENU

Make type required as we don't support entries without type. Indeed this model
is used to automate menus generation / destruction, and not for hand-made
menus. We therefore set type as required and add a cascade ondelete for
selection.

SPECIFCIATIONS: COMMUNITY MENU

Doing this change allows to define community menu in website_event and re-use
it in website_event_meet and website_event_track_quiz, removing some
unnecessary dependencies. This menu is void in website_event, and displays
either meeting rooms (in meet) or quiz points leaderboard (in quiz), or a
mix of both if the two features are installed.

LINKS

Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#165
2020-08-21 17:30:13 +00:00
Thibault Delavallée 0a17b8a7ef [MOV] website_event: reorganize module content
PURPOSE

Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae

Also clean website event menu not being available in website event but only
in website event track, which implies some extra-code to manage it.

In short: merge website_event_online in website_event, website_event_track
_(online/session) in website_event_track.

RATIONALE

_online modules have been added to extend content of website_event and
website_event_track without having any impact on those module. First step
of cleaning is to move this content directly in base module.

track_session module is mainly a rewrite of track module. Second step of
cleaning is to move its content directly in website_event_track.

SPECIFICATIONS

Quickly reorganize some bits of code in website_event module to ease future
integration of code from _online sub-modules. It also helps understanding
and finding its way through the module.

Split python files by model: notably event.type outside of event.event file
and code.

Reorganize templates by main use

  * _list: list view of events;
  * _page: page view of events, either event itself or registration flow
    (_page_registration);
  * move side templates in side files;

LINKS

Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
2020-08-21 17:30:13 +00:00
std-odoo 3dfb3c1e74 [FIX] website_event(_*): improve user flow and experience from frontend
PURPOSE

Provide some fixes after internal test deployment of event online features.
Notably: user registration flow, various fixes in templates.

Also add some unit tests to avoid regressions while working on event features.

LINKS

Task ID-2169118
odoo/odoo#55967
odoo/enterprise#12438

X-original-commit: e66684b23eebaadc3df7b908427d3d7a83d4f0a0
2020-08-17 16:29:49 +00:00
Thibault Delavallée 01f93f7a4b [FIX] website_event(_track): allow event managers to unlink menus
Followup of 69d2513de21c2e80de605f77912a3687b8a79c6d : fix computation of menu fields values to
be more inlined with base menu option (website_menu) + True by default when
activating menus.

Also force update when writing directly on a menu field to ensure coherency
of website.event.menu.

PR #55325

closes odoo/odoo#55340

X-original-commit: 19d028aa885d5623ae98b26ad135a1b29c89d5ee
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-08-03 15:10:14 +00:00
Thibault Delavallée 8968e8b941 [FIX] website_event(_track): allow event managers to unlink menus
closes odoo/odoo#55286

X-original-commit: 5fc2bbd12f5bce7a2153d5f51751bea419c3a3e7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-31 21:00:21 +00:00
917ad9a9a9 [REF] website_event(_track): better support menu management from frontend
RATIONALE

Events are sometimes held online, gathering a community. In this merge we
improve Event application to better support full-online events with improved
tracks, wishlists, chat rooms, ...

PURPOSE

New and improved pages are about to land for online event. However current
menus and pages management is hard to tweak, especially when dealing with
the stable policy of 13.3 .

SPECIFICATIONS

Refactor and improve code about event menu management. Purpose is to
ease inheritance and be able to add menus and pages with less custom code
in sub modules.

Refactor some code, notably

  * code dealing with menus to activate and de-activate that is duplicated
    for each kind of menu;
  * allow to give a menu_type through inheritance in create_menu notably to
    support website.event.menu model available in Track app and unfortunately
    not in website_event;
  * make a somehow generic way of getting fields dealing with menu items
    through simple inheritance;
  * support sequence to allow ordering of menu entries by propagating the
    sequence to website menus;

Behavior in website_event and website_event_track should be the same. Behavior
will be tweaked in other modules through inheritance..

Improve behavior when removing frontend menus

  * correctly fetch views (for Introduction / Location) and try to unlink them
    to avoid bloating the db;
  * update boolean menu fields according to website menu management. Removing
    a menu from frontend should be reflected on boolean fields of event;

LINKS

PR #55260
Task ID-2310491 (Event Online Preparation 5)
Part of Task ID-2252655 (Main Online Event task)
Part of Task ID-2283796 (Event B2Basics / Registration Flow)

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-07-31 18:05:12 +00:00
jvm-odoo 40861fc1ef [FIX] website_event: prevent foreign key violation when deleting menu
Issue

	- Install Events
	- Any Event > Edit
	- Toggle website menu
	- Go to website > Edit
	- Add anything > Save
	- Edit in backend
	- Toggle off website menu > Save
	- Toggle on website menu > Save

	Traceback foreign key violation

Cause

	We unlink the website menu view
	but not its childs.

Solution

	Use `_force_unlink` context key to delete all inherited views too.

OPW-2291645

closes odoo/odoo#54918

X-original-commit: a21401f84a0baebe33ca7adc11f85d538afd51ec
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-24 14:40:13 +00:00
Thibault Delavallée 1db746419f [REF] website_event(_track): reorganize website menu management code
RATIONALE

Even will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff.

PURPOSE

In this commit we simply move some code in website_event and event_track to
better separate code about menu management from other code. It allows to
understand code organization and will lessen diff of future commits improving
menu management.

LINKS

PR #54801
Task ID 2304817 (Event Preparation 3)
Prepares Task ID 2252655 (Main Online Event task)
Prepares Task ID 2283796 (Event B2Basics)

X-original-commit: 35b265f1950e9f2977edc940645c35efef19e3c9
2020-07-23 09:55:01 +00:00
Thibault Delavallée 97c6a79fba [FIX] website_event: allow event users to update menu entries
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATIONS

Fix issue when updating menu organization fields on an event. Indeed it implies
some website menu and pages creation or unlink. Currently it crahes as only
website people can do it. Being an event user or manager should be sufficient
to update those menus

LINKS

Task ID-2300907 (Event Bugprovements 2)
PR #54621

X-original-commit: 264ebb6af3e991030a2f803281b90267502a0f84
2020-07-22 11:13:18 +00:00
Sébastien Mottet (oms) 561ac8d889 [FIX] website_event: move toggle_website_menu method to website_event
toggle_website_menu (in website_event_track module) is called by website_event
set_customize_options (in website_event module). Since website_event_track is
not installed by default when website_event is installed, this function might
not be available in the event.event model. Therefore toggle_website_menu has
been moved from the event.event model in website_event_track to the event.event
model in website_event.

Followup of bd99cc24b1

Task ID 2244487
PR #51503

X-original-commit: e541efe1338f853962560db4d982821707ddc3c6
2020-05-19 10:14:40 +00:00
DramixDw 9b9829416b [IMP] website: simplify website menu
Some apps, once installed, automatically create a menuitem in website.
What complexify the UI and create useless menu withtout plusvalue.

It is not because you install livechat to make support online, that you want
a link in your menu to show stats e.g.

Now we remove the default menu created, and help user to find it when he create
a link. The autocomplete suggest most of the main App's controllers

task-2189613

closes odoo/odoo#49081

Related: odoo/enterprise#9733
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-05-01 07:59:07 +00:00
Patrick Hoste bd99cc24b1 [IMP] website_event(_track): improve website and track menus behavior
PURPOSE

Before this commit to activate the sub-menu, the tracks and the track proposal
you had to do it on the event form view. After this commit you'll have to go
on the event website page to change those options (through the customize dropdown)

SPECIFICATION

Remove the 'website_menu' / 'website_track' / 'website_track_proposal' from the
event form view and create a toggle option in the customize dropdown on the event
website page instead.

LINKS

Task ID : 2198660
PR : #46659
2020-03-31 06:34:45 +00:00
Patrick Hoste 37d281681c [FIX] website_event(_track): fix duplicate submenu
PURPOSE

Before this commit when updating an event with website_menu, website_track or
website_track_proposal activated it created an extra sub menu even if already
created. This commit fix this issue.

SPECIFICATIONS

Check if the menu doesn't exist before creating it.

LINKS

Task ID : 2210441
PR : #47058

closes odoo/odoo#48451

X-original-commit: d6e334d48aace3fce196bb0652915cd5232ffbe7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-26 15:57:21 +00:00
Romain Derie e7ef57f687 [FIX] website_blog, website_event: prevent wrong meta og:image URL
Without this commit, if the cover properties's background-image contains single
quotes in the `url()`, that will lead to 404 image in SEO dialog.
It will also lead to wrong og:image in the DOM.

Before:
`<meta property="og:image" content="'website_blog/static/src/img/cover_1.jpg'"/>`
Now:
`<meta property="og:image" content="http://localhost:8069/website_blog/static/src/img/cover_1.jpg"/>`

This is the case for all our demo data.

closes odoo/odoo#47994

X-original-commit: 2338f8ecc8c21299774e288ab07bb084a58cc7ab
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-03-19 10:15:37 +00:00
Thibault Delavallée e7c4e94275 [FIX] website_event: copy website_menu when copying an event
Currently website_menu boolean field is not copied when copying an event. It
comes from an issue related to duplicating website menus. It seems real issue
has been fixed at 1a8993e0cb . Current copy=False on website_menu is a wrong fix
due to some mismatch in forward-port. We can therefore copy website_menu
again.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
2020-03-10 11:15:09 +00:00
Thibault Delavallée 968ef0223f [REF] website_event(_track/_question) : move from onchange / default to stored editable computed fields
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS: GLOBAL RULES

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

SPECIFICATIONS: WEBSITE_TRACK(_PROPOSAL)

Keep an explicit onchange for tick / untick of website_track_proposal. Indeed
otherwise you have a loop of dependencies between website_track and
website_track_proposal

  * untick website_track: website_track_proposal = False (done in _compute_website_track_proposal)
  * tick website_track: no effect
  * untick website_track_proposal: no effect
  * tick website_track_proposa: website_track = True

It would be complicated to write in computed fields, as they depend on each
other, on cache and current values, ... It is therefore simpler to keep an
onchange: when ticking website_track_proposal set website_track as True in
interface.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
2020-03-10 11:15:09 +00:00
Thibault DelavalléeandMichaël Mattiello 5e4efef3ca [REF] event : move from onchange / default to stored editable computed fields
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS: GLOBAL RULES

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

SPECIFICATIONS: REQUIRED FIELDS

As computed fields are computed after create required attribute cannot be
respected without computing them beforehand. That is why we have some custom
code to compute required fields if not given at create and update the creation
values accordingly.

SPECIFICATIONS: MAIL SCHEDULING

Mail scheduling on event type is modified in this commit. Previously checking
the use_mail_schedule radio button had no effect on event_type_mail_ids field.
It is now reset if unchecked. It is therefore coherent with use_ticket and
event_type_ticket_ids field behavior.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Michaël Mattiello <mcm@odoo.com>
2020-03-10 11:15:09 +00:00
Thibault Delavallée 2235176347 [MOV] website_event(_track): rename some odd methods and files, remove dead code
In order to keep things organized, let us move some models in their own file
and rename some test files. Some odd methods are relocated to better follow
guidelines. Dead code is removed because we do not like dead code.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
2020-03-10 11:15:08 +00:00
Xavier Morel de590816d8 [FIX] *: deprecated access to url_ utilities through werkzeug root
In 0.15 accessing werkzeug.urls functions directly through werkzeug
is deprecated, the shortcut will be removed in the eventual werkzeug
1.0.

Fix existing uses of these shortcuts. Also cleanup some imports when
they're not far from a werkzeug* import being altered.
2020-02-04 12:42:35 +00:00
Romain Derie 4eb2aeb8e7 [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
2020-02-04 13:06:08 +00:00
Romain Derie 8fc61fd2b4 [REM] website(_blog/_event): remove filtercolor option on cover
task-2144335
2020-02-04 10:59:22 +00:00
Thibault Delavallée 8bc9d77104 [IMP] (website_)event: clean fields definition and parameters
In this commit we prepare future event model changes by reordering removing
unnecessary parameters definitions, notably readonly set to False as it is
the default value. Those parameters notably come from 412ff994f1 .

Some reordering is also done in order to better understand future pre / post
change model organization.

LINKS

Task ID 2177281 (support tickets directly in event)
Prepares Community PR odoo/odoo#43488
Closes Community PR odoo/odoo#44066
2020-01-28 10:54:46 +00:00
Thibault Delavallée abcd6c15cf [MOV] (website_)event(_sale/_question/_track): split main model files
PURPOSE

As event will soon evolve (onchange -> compute, code improvements, addition of
new features) cleaning and improving tests is necessary to help avoid issues.

SPECIFICATIONS

As event model grow in complexity and features, it is easier to find its
way through the application with having registration model lying in its
own file to separate it from event-specific models (event.type, event.event).

Ticket (event_sale) and sponsor (website_event_track) models are also extracted
in their own file.

LINKS

LINKS

Side effect of Task ID 2089156 (event onchange to compute)
Community PR odoo/odoo#43127
Enterprise PR odoo/enterprise#7656
2020-01-10 16:06:40 +00:00
Samuel Degueldre d513c662e0 [IMP] website, *: add full height option and scroll down button
*: website_blog, website_event

This commit adds a "Height" option to sections, allowing them to have a
minimum height of the user's choosing (either full screen height or half
screen height, similar to blog covers). Enabling the full screen option
also allows the user to add a "scroll down button" that will scroll down
to the next section, also similar to blog covers.

As such, the classes doing the corresponding things in website_blog and
website_event have been renamed to reuse the same code.

task-2155710

closes odoo/odoo#41623

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-01-08 14:13:36 +00:00
Romain Derie 9b38bcec12 [IMP] website, website_*: improve edit in backend feature
*base, website_blog, website_event, website_forum, website_slides

With this commit:
1. It is now possible to add the 'Edit in backend' entry in the frontend navbar
   for any desired model, not only the ones which have the published mixin.
   It will simply redirect to the main_object form view.
   This commit add it to Forum and Blog.
2. When clicking on 'Edit in backend', it is now possible to land on another
   module than Website.
   That's especially useful for events and slides which are not directly
   related to the website module as they have their own module.
3. Remove the custom Edit in backend from the forum homepage (fa-cog).
   Opportunity was also taken to remove the 'edit welcome message'.
   It will now be editable through the editor (welcome message will appear in
   edit mode). Thus we got rid of the custom edit welcome message controller
   and views.

Closes #36325
2019-10-02 07:13:26 +00:00
f402afd7b5 [REF] website_event, *: review event design and features
* event, website_event_questions, website_event_sale,
  website_event_track, base

Part of https://github.com/odoo/odoo/pull/37009
task-2043872

Co-authored-by: qsm-odoo <qsm@odoo.com>
Co-authored-by: Jérémy Kersten <jke@odoo.com>
2019-09-27 13:36:37 +00:00
Nicolas Martinelli e3d2b018c2 [FIX] website_event: track publishing
When an event is published/unpublished, the 'Is Published' value appears
twice in the chatter.

This is because `website_published` is defined as a related of
`is_published`, and `is_published` is tracked. The button calls
`website_publish_button` which triggers a `write` on
`website_published`, the latter triggering a `write` on `is_published`.

The situation is quite exceptional: we usually don't define a related on
a field of the same model. Therefore, we can simply change the field
tracked.

opw-2073804

closes odoo/odoo#37128

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-19 09:46:30 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Parth Choksi 378d7478b6 [IMP] website: improvements in SEO dialog
In this commit, we have changed behaviour of SEO dialog. Now when you
keep title and description fields empty, then the page will use default
title and description. We have added default_title and default_description
to render the preview with default values when title and description
fields are empty in SEO dialog.

Task ID:1949636

closes odoo/odoo#32449

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-05 11:34:19 +00:00
Christophe Simonis 8c29df10e0 [MERGE] forward port branch saas-12.1 up to 93d736e905 2019-02-11 17:00:35 +01:00
Christophe Simonis 93d736e905 [MERGE] forward port branch 12.0 up to 6e8dff1952 2019-02-11 16:17:02 +01:00