Commit Graph
52 Commits
Author SHA1 Message Date
Thibault Delavallée 237911775c [REF] website_event_*: remove manual datetime patch
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
2021-12-16 17:33:47 +00:00
Thibault Delavallée db19463f25 [REF] event(_*): clean tests common files
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
2021-12-16 17:33:47 +00:00
Thibault Delavallée 777d0d316e [IMP] website_event(_track): reorganize tests
Purpose is to merge some tests, clarify naming and reorder files according
to their content.

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
Damien Abeloos 72fab547fb [MOV] website_event: move the website_event tour to tests/tours
* 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
2021-03-03 12:43:30 +00:00
Thibault Delavallée 87f3891244 [IMP] event, website_event_track: add tests about stored editable computed fields
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
2021-02-11 12:41:47 +00:00
Thibault Delavallée f3356904b6 [MOV] website_event(_track/exhibitor): move sponsor model directly into Online Exhibitors
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
2020-12-04 07:49:30 +00:00
Raphael Collet 1398b6b44c [IMP] tests: deprecate SavepointCase
closes odoo/odoo#62031

Related: odoo/enterprise#14872
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-11-24 13:23:32 +00:00
Thibault Delavallée 1404af789c [REF] various: use helper to create tests users
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
2020-08-28 07:59:23 +00:00
Thibault Delavallée 1163013ed6 [REM] website_event_track_online: merge into website_event_track
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
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
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
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
Thibault Delavallée cbee702ba4 [REF] website_event(_track): improve tests and test classes
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
2020-07-23 09:55:02 +00:00
Patrick Hoste 14ce43f2ee [IMP] event: change name field from event registration + minor changes
PURPOSE

Make 'name' field from event registration mandatory.
Change placeholder for event name to give an example.

LINKS

Task ID : 2093336
PR : #43420
2020-02-04 15:07:43 +00:00
Yannick Tivisse def5d84df7 [IMP] website_event: Adapt tests to work with/without demo data 2019-11-05 16:18:10 +01:00
Sébastien TheysandJairo Llopis 1781041f13 [IMP] website, website_event, website_slides: add rel=canonical tag
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.

closes odoo/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>
2019-09-03 12:11:35 +00:00
Sébastien Theys df7326f0be [IMP] tests, *: add start_tour helper
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.

closes odoo/odoo#32316

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-04-04 08:44:59 +00:00
Lucas Perais (lpe) b5c7099b95 [FIX] website_event[_track]: create menus on create
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

closes odoo/odoo#30919
2019-02-07 13:43:00 +00:00
Christophe Monniez b356b19033 [IMP] tests: Add the possibility to tag tests
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.
2018-01-18 13:20:37 +01:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
qsm-odoo f9a84b5ebc [IMP] web_tour, *: allow to properly extend tours
* 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.
2016-08-26 13:39:55 +02:00
qsm-odoo eaf8e82efb [IMP] *: activate automatic tour tests
* project, crm, point_of_sale, website, website_sale, website_blog,
website_event, website_forum
2016-07-18 14:22:29 +02:00
Dharmraj Jhala 616f294786 [MIG] website_event: migrated into new API 2016-04-14 11:56:45 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- 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.
2015-06-02 03:16:04 +02:00
Géry Debongnie ebc39b8788 [FIX] update tests to new module system
Various tests (mostly tours) were broken with the large changes in the
way the js code works.
2015-03-18 09:23:37 +01:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Christophe Matthieu 36d8954d87 [FIX] website: blog and event must be tested with admin login 2014-07-02 14:52:45 +02:00
Christophe Matthieu 8914453a50 [FIX] website: enable test for blog, event... 2014-07-02 14:09:57 +02:00
Christophe Matthieu bc3fc54fac [IMP] Tour: add tour in web module; tour became available in backend. 2014-06-18 12:25:13 +02:00
chm@openerp.com b28a32f6ef [FIX] website: test_ui running
bzr revid: chm@openerp.com-20140326144442-ye2a51f03wyaxi8a
2014-03-26 15:44:42 +01:00
chm@openerp.com 62814f9c23 [FIX] website: activate new tour tests
bzr revid: chm@openerp.com-20140324081112-15n58puu29weydme
2014-03-24 09:11:12 +01:00
Xavier Morel 61c82f28a4 [FIX] imports, use @expectedFailure, simplify some inject specs
bzr revid: xmo@openerp.com-20140218160339-2r34z4ks2o4lriu5
2014-02-18 17:03:39 +01:00
Antony Lesuisse d8c5a1c4c2 [FIX] website_event tests
bzr revid: al@openerp.com-20140210013203-f1ow6lm34wma4xv3
2014-02-10 02:32:03 +01:00
Antony Lesuisse 70d498c14a [FIX] disable http test before conversion
bzr revid: al@openerp.com-20140209141950-o9sf0jual07y315f
2014-02-09 15:19:50 +01:00
Christophe Matthieu e8964f896c [FIX] website: tour, test and test_runner
bzr revid: chm@openerp.com-20140206140746-jmeyx8q9qxv7sz1j
2014-02-06 15:07:46 +01:00
Christophe Matthieu d23f8425ad [FIX] website tour: flickering; banner auto run; work with different language
bzr revid: chm@openerp.com-20140203112816-c350lxr5pgo9x2li
2014-02-03 12:28:16 +01:00
Christophe Matthieu 5400c508e5 [FIX] website tour test
bzr revid: chm@openerp.com-20140130232330-kgrw8e7d0ez3f3pp
2014-01-31 00:23:30 +01:00
Christophe Matthieu ed45f41f9b [FIX] website tour test + add test for shop
bzr revid: chm@openerp.com-20140130224453-e0drwj4m54vymahz
2014-01-30 23:44:53 +01:00
Christophe Matthieu 5e10f80cd4 [fix] website: test tour
bzr revid: chm@openerp.com-20140130215717-h211wj65wl20zfru
2014-01-30 22:57:17 +01:00
Christophe Matthieu 110f3dd910 [IMP] website tour: refactoring: Check dom insead of trigger
bzr revid: chm@openerp.com-20140130210001-kiecx5nde2um3ni1
2014-01-30 22:00:01 +01:00
Christophe Simonis ec14f457c1 [FIX] website_event: correct ui test
bzr revid: chs@openerp.com-20140129213621-ynbxys4hmw0avhaw
2014-01-29 22:36:21 +01:00
Fabien Meghazi df63fcba81 [MERGE] upstream
bzr revid: fme@openerp.com-20140122102232-77lvvwpzet58sa7p
2014-01-22 11:22:32 +01:00
Christophe Matthieu 5d78f8f064 [FIX] website: import full_path
bzr revid: chm@openerp.com-20140121100524-elxz0n8qfve1iefr
2014-01-21 11:05:24 +01:00
Christophe Matthieu 849fc19aa1 [FIX] website: import openerp.addons.website_blog.tests
bzr revid: chm@openerp.com-20140121093415-ork5jis48mmq4dp8
2014-01-21 10:34:15 +01:00
Christophe Matthieu 53d8280f1d [IMP] website: test class with test for website_sale sale process
bzr revid: chm@openerp.com-20140120182643-tw65rig4qqi3sqqf
2014-01-20 19:26:43 +01:00
Fabien Meghazi 96c79572f8 [FIX] test ui should use /login route for auto login
bzr revid: fme@openerp.com-20140115161318-v8ksw0u0u1mpgn0x
2014-01-15 17:13:18 +01:00
ddm@openerp.com 715f5355e0 [FIX] remove ugly non-fix
bzr revid: ddm@openerp.com-20140109134446-1hy61f37dqclt3g4
2014-01-09 14:44:46 +01:00
ddm@openerp.com 38ffa6f93e [IMP] event UI tests
bzr revid: ddm@openerp.com-20140108171225-tzarqg6xy8a7sez3
2014-01-08 18:12:25 +01:00