Use freezegun as it is more easy to use and allow to remove a lot of extra
boilerplate. Indeed manually patching datetime is a PITA as a lot of imports
have to be patched.
A custom patching has to be done for create_date, as it is done using a value
stored on the cursor (cr._now), based on SQL now. As it has nothing to do
with standard python library it cannot be patched using freezegun.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
Purpose is to have a common event class for users and useful stuff (customers,
products, ...) but lessen usage of common test data through sub modules.
Indeed having a "global event type" test data updated in various addons is
actually complicated to maintain.
Sub add-ons are updated to use mainly the ``EventCase`` test class holding
users and side data. Data specific to those modules (event type with some
specific configuration notably) is created and used in tests in the given
module only, and not through generic event_type_complex and event_0 test
data anymore.
With this commit tests are more localized to their add-on and modifying data
in a given add-on has less chances to have unwanted side effect in other event
submodules unit tests.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
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
* Reassign the "event" tour to a classic test
- Only the "event_tour" that starts from the Event App should be kept from a
user perspective.
- The "event" tour that launched itself once upon installing the Event App
from the Website (Website App) and only covered the front-end part of
the event creation will now only be kept as a classic test tour.
- This tour is renamed "website_event_tour" instead of "event" for
disambiguity with the other tour called "event_tour"
* This tour is now only intended to be used as a test, and as such, is moved
to `tests/tours`
Task ID : 2410217
PR : #63370
Add tests related to registration / partner contact fields synchronization.
Add tests with user input and/or partner synchronization to ensure editable
stored fields work as expected on registration model.
Add tests related to event track / partner contact fields synchronization.
Add tests with user input and/or partner synchronization to ensure editable
stored fields work as expected on track model.
Add tests related to event / event type configuration fields synchronization.
Add tests with user input and/or event type synchronization to ensure editable
stored fields work as expected on event model.
Warning: those tests are currently partly failing. Next commits will split
computed fields into several methods in order to fix computation.
LINKS
COM PR #65688
Task ID-2455165
X-original-commit odoo/odoo@6b0346bbb5
X-original-commit: 7f0c7339c39b05e20efa163d0ea91f7dd5c0017c
RATIONALE
Events often have sponsors displayed on their front page. This should be
a real standalone feature of Online Event application. However currently it
cannot be used without tracks managements
PURPOSE
Purpose of this task is to allow to use and display sponsors on an Event front
page without using tracks. Moreover online and chat capabilities should be
part of a sponsor feature, located within website_event_exhibitor module.
SPECIFICATIONS
Move everything related to event.sponsor model from website_event_track
to website_event_exhibitor. Functionally feature should be the same as
before except that we should be able to configure and display sponsors
directly with website_event_exhibitor application without using tracks.
Website_event_exhibitor should also define the sponsor template used to
display sponsors below an event.
LINKS
Task ID-2326433
COM PR odoo/odoo#61781
ENT pr odoo/enterprise#14752
UPG PR odoo/upgrade#1931
PURPOSE
Lessen use of mail-specific calls and variables
SPECIFICATIONS
Use mail_new_test_user tool in tests, lessening use of mail-specific context
keys in tests.
LINKS
Task ID-2326281 (context keys use cleaning)
PR odoo/odoo#56631
PR odoo/enterprise#12707
X-original-commit: 910559c092dc7dfa00b91339a5423e16cd4668e1
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 track online to website event track.
Agenda notably is completely replaced by the new one developed within
track_online module.
Update dependencies accordingly.
LINKS
Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
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
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
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#55967odoo/enterprise#12438
X-original-commit: e66684b23eebaadc3df7b908427d3d7a83d4f0a0
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>
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., ...
SPECIFICATIONS
Improve website_event and website_event_track test coding style, notably
* use specific users when performing tests to trigger access rights issues
(this notably allowed to find an issue with event groups not allowed to
update menus);
* define common classes;
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: 774211c7e4667c5350ac090510e72c106f2d10b6
The canonical tag is important for SEO, indeed it prevents search engines from
indexing duplicate content.
Reasoning
=========
The choice has been made to create the canonical tag automatically depending on
the request path, ignoring the query string, and manually prefixing the
appropriate domain and language code.
Indeed creating it manually for each resource would create a lot of code and
potential mistakes.
It is more dangerous to do it the generic way, but after investigation it
appears that it is an acceptable trade-off since the vast majority of our routes
are well built and already ready for this:
- using query string only for minor features that do not change the main content
- having the models, the ids, the pager and other important features in the path
Override
========
It is still possible to override the default behavior by passing
`canonical_params` manually to the view or to the different methods.
This is done for `/event` because the only way to display Past Events is to add
`date=old`.
Languages
=========
Fix an issue where it was possible for a bot to be on the URL without language
code but to use a language that is not the default language.
Adapt hreflang, because it:
- must only be present on canonical pages
- must always lead to canonical pages
- should not be set if there is no alternate language
Misc
====
task-1958075
closes#12532
Inspired by OCA module `website_canonical_url` courtesy of Jairo Llopis.
closesodoo/odoo#35852
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Jairo Llopis <jairo.llopis@tecnativa.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
Before this commit, the syntax to start a tour was extremely verbose.
With this new method, it is possible to start a tour by just giving the
essential parameter: the tour name.
The full set of features from browser_js are kept by using **kwargs.
closesodoo/odoo#32316
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Before this commit, the website menus were created only on write on an event
After this commit, the menus are created at create time too
OPW 1914343
closesodoo/odoo#30919
Purpose: When running tests, all the tests for the installed/updated
files are done. This commit adds a 'tagged' decorator that can be used to
tag tests. Combined with a new 'test-tags' CLI option, it adds the ability
to filter which tests are executed. For example, @tagged('slow') will
add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will
only run tests tagged 'slow'.
One can use prefixes to select cases with tags.
'+' or no prefix means that the tests tagged with this tag are selected
for execution. '-' prefix will exclude the tests tagged with this tag.
Exclusion takes precedence over inclusion.
Also, by default, all Odoo tests cases are tagged 'standard' and with
the technical name of the module.
This means that when selecting tests with the 'test-tags'
parameter, if '-standard' is not specified, all tests tags are
going to be executed.
When tagging tests, one can remove such automatic tag by prefixing the
tag name with '-'. E.g. @tagged('-standard') will remove the standard
tag from the test.
Another example, if one wants to test the 'sale' module alone,
even without adding any 'tagged' decorator thos tests can be selected
like that: --test-tags="sale"
Tests are selected or deselected using a TagsSelector. When instanciated,
a string is passed with comma separated tests selectors like
'+slow,-standard'. When the 'check' method is called with a test as argument,
it returns True or False if the test has to be executed or not.
* crm, project, website, website_event, website_blog, website_forum,
website_sale
Eg: the tour 'shop_buy_product' is extended by the website_sale_options
addons to add a step to close a modal.
The current solution was requiring the module that defines the tour
to extend, then add/remove steps in the "step" key of the tour
definition.
Some of the problems with this method were:
* The "register" method calls the "update" method to immediately
search for tip to place once registered (as register may be called
after the DOM is ready). So extensions of tours were happening after
the tours were started (and the tours were not restarted).
* The addition/removal of steps was happening after they were filtered
according to the "edition" key.
To allow extension, the system is changed as follow:
* The "register" method now only saves the steps and options without
modifying them and does not call the "update" method.
* Once the DOM was ready, the tour service started listening to DOM
mutations and called the "update" tour method. Now, this "update" call
is replaced by a "_register_all" call, on DOM ready and at the end of
the current call stack (which makes sure all modules are loaded). This
"_register_all" method marks the registered tours as ready after having
filtered the steps according to the "edition" key and initialized the
current step to trigger.
* Also, tours can now define a "wait_for" option which allow them to
be marked as ready for run and update after the given deferred. Those
tours can now also be extended without having to wait for the deferred.
PhamtomJS must wait for the "ready" key to be true to run the tour.
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
automatically in all countries thanks to Berne Convention + WTO rules,
and a reference to the applicable license is clear enough.