Commit Graph
40 Commits
Author SHA1 Message Date
Benoit Socias a676344ecc [FIX] website{_*}: not truncate URLs in search results
website{_*}: website, website_blog, website_event, website_forum,
website_sale, website_slides

Since the generic search bar was introduced in [1] all text fields were
truncated in search results.
This caused problems for long URLs which were truncated as well, and
therefore could become invalid.

After this commit URL fields specify `'truncate': False` in their search
detail metadata, which informs the rendering to skip the text truncation
step for that field.
Also added previously missing controller-level tests of the
autocompletion.

Steps to reproduce:
- start odoo with website_forum and demo data
- go to the Help forum
- search for "configure" in the Help forum
- click on the auto-complete suggestion
- => redirected to a 404 page because the URL was shortened
To test the fix on other models, use a long enough name that causes the
problem. E.g.: "This product has such a long name its URL would have
been truncated without the fix contained in this branch".
Note that the problem did not occur on blogs because the URL does not
contain the name, but the same fix was applied for consistency.

[1]: https://github.com/odoo/odoo/commit/7559626c54e34b41e1549e28276a650accec6986

task-2727788

closes odoo/odoo#82621

X-original-commit: 045f741be35e62f5e3a636490c6c1d475b5d78eb
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-12 14:55:03 +00:00
Thibault Delavallée d55165931a [FIX] website_event: pre-compute website_menu
With this commit we ensure website_menu field is computed before calling
create. Indeed otherwise it is computed after the create if value is not
given and stays to False. This is due to the compute that does not distinguish
a False value from user from a False value added as default. This breaks
the event type -> event synchronization when no form view is used (either
through UI or in code).

With this commit, it is computed before resuming the creation and field
is correctly synchronized with the template value unless the user gives
a value at create time.

Task-2341656 (Event submenus shenanigans)

Part-of: odoo/odoo#81068
2021-12-16 17:33:48 +00:00
Thibault Delavallée ad445aaff1 [FIX] website_event: correctly cleanup when removing event website menu
Currently if event website menu main checkbox is unchecked the related website
menu is removed. Its children are also removed through the cascade attribute on
parent_id field.

However this is done in SQL, meaning some overrides on unlink of website.menu
is not called. This does not properly cascade unlink views linked to website
menus through the specific "website.event.menu" model. This leads to some
views staying alive in DB. This causes issues with web editor when calling
``_views_get`` as he may receive several views linked to a given view_id (key)
while it expects only one.

We fix that behavior by removing the menu and its children explicitly. This
calls various overrides done in website_event.

Task-2616588

X-original-commit: 9722baee83adea9808de1247c300e226cf6fc537
Part-of: odoo/odoo#80391
2021-11-25 13:28:51 +00:00
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
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
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
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
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