Commit Graph
30 Commits
Author SHA1 Message Date
Florian Charlier 9540dc7772 [IMP] event: Improve logic and appearence of archived registrations
When an attendee's registration was archived, their seat was still
considered taken, which could be problematic such as in cases of
limited seat availability.

Only non-archived registrations are now counted as seats. The same
error as with regular registrations will be raised if there are not
enough seats available to un-archive a registration. These ValidationError
messages now show the name of the fully booked event.

A few python tests are included to verify the impact of (un)archiving on
seats availability for events and for event tickets.

The appearence of archived registrations was also not different in form
and kanban views, which is somewhat confusing and inconsistent with the
aspect of archived records in Odoo. Actions buttons are not available on
archived records.

Filtering in the archived records needed to be simplified from a "Custom
Filter" to a one-click feature, already available for many models.

Task-2646298

closes odoo/odoo#77715

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-17 11:04:53 +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
qmo-odoo b18efd703c [IMP] event: add default communication on events
Communication on events is considered as standard: receive a confirmation
at subscribe and receive reminders. We therefore set default event mail
on both template and event models

  * event.type has default communication with 3 emails;
  * event.event has default communication when no event type is chosen. When
    a template (event.type) is chosen its configuration is more important;

Task-2488019
PR odoo/odoo#68901
2021-08-23 14:59:00 +00:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00
Debauche Stéphane d9ffbe9e89 [IMP] event: merge the SMS template and the mail template into one field
Purpose
=======
A new module "Event Social" will be added in the enterprise PR. This
new module will use a new template type, the "Social Post Template"
adding one more column in the communication tab...

We want to have only one column to select the template (Mail, SMS or
Post template) and therefor we need to use a reference field.

Technical
=========
As we can not set a domain on a reference field, we added a context key
and in the `_name_search` of the `mail/sms.template` we filter with the
domain we want if the key exists.

Links
=====
Task-2127615
See odoo/odoo/pull/46304
See odoo/enterprise/pull/7701
See odoo/upgrade/pull/848
2021-07-14 08:32:59 +00:00
nounoubensebia 89d72df22b [IMP] *_event_*: revamp event template form
This commit revamps the event template form to be similar to the event form
itself and removes unnecessary fields, purpose is to give more clarity to the
user.

It also fixes the order of the fields in the event form to be exactly
the same as in the front-end, so that the user don't get confused.

Task-2541208

closes odoo/odoo#71856

Ent-pr: https://github.com/odoo/enterprise/pull/19128
Upg-pr: https://github.com/odoo/upgrade/pull/2516
Related: odoo/enterprise#19128
Related: odoo/upgrade#2516
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-01 09:37:41 +00:00
nounoubensebia 417622d655 [IMP] [website_]event[_questions|_sale] datetimes sales start/end
changed the start/end date fields to datetime fields, in order to allow more
flexibility for the user and enable them to set a precise point in time at
which ticket sales should start/end, because otherwise ticket sales/end would
always be set at midnight which is not very flexible.

Task-2431440

closes odoo/odoo#65133

Related: odoo/upgrade#2126
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-25 14:58:20 +00:00
Damien Abeloos 498eb0cfed [IMP] event: improve the event form editor and update the tour
* In the Communication tab, prevent inserting multiple duplicate lines
  upon switching template.
    - Before, when the user was switching between templates, the lines
      introduced with the last template were not removed, and the amount of
      lines only kept increasing.
    - Now, only the lines that are linked to a registration are kept

* In the Tickets tab, prevent inserting multiple duplicate lines upon
  switching template (Ticketing) if there was already tickets linked to a registration.
    - Same problem as in the Communication tab, multiple lines could be introduced.
    - Now, only the lines that are linked to a registration are kept

* Add 2 tests (compute mails and tickets) to ensure those behaviors are properly
  maintained in future updates. As the issue occured only in a non-saved Form when
  switching event_type templates, the tests are a little low level (since we have
  to check the computed results directly in the Form).

* Remove the last 2 steps of the event_tour :
    - They are a bit out of scope and they break the rythm (better to end on a high note)

Task ID : 2410217
PR : https://github.com/odoo/odoo/pull/63370
2021-03-03 12:24:55 +00:00
Thibault Delavallée 6986faf533 [FIX] event: split stored editable computed fields compute method
RATIONALE

Stored editable fields receive their values either from compute either from
user input. If a user input is given to create / write compute method is not
called. If multiple fields are computed through the same method giving one
field value discard call to compute method and other fields are not called.

SPECIFICATIONS

Split ``_compute_contact_info`` compute method so that partner related fields
are independent.

LINKS

COM PR #65688
Task ID-2455165

X-original-commit odoo/odoo@dfc319f584

X-original-commit: c251048cfead27d12117557fe4b6601bef39e8e1
2021-02-11 12:41:47 +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
Aurélien Warnon 9622ffe442 [FIX] event: make ticket sale start date inclusive
This commit fixes the ticket sale start date to be considered inclusive.

Indeed, before this commit, if the sales of a ticket starts on the 1st of
December, people arriving on the website at that exact date will NOT be able to
buy tickets although they should be. They will have to wait for the next day to
be able to buy tickets.

A small test was added to ensure this behavior.

Task 2415917

closes odoo/odoo#63685

X-original-commit: ea6952fd7ec881b79a7294c40427ce9966997e66
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-22 12:01:05 +00:00
Sébastien Mottet (oms)andThibault Delavallée be11161a42 [FIX] event(_questions): take better care of 2many fields when updating from event type
PURPOSE

Fix various issues spotted in 13.3 when testing event. Notably
computation of 2many fields coming from template.

SPECIFICATIONS

When updating template on an event, one2many fields should be better managed.
Previous heuristic was

  * if event type uses o2m configuration (use_ticket / _schedule / _question)
    and has lines

   * erase existing lines;
   * create new lines based on old one;

This has the drawback of loosing information of what is sent (mail) or
sold (tickets) or answered( questions). Another drawback is that only
types having line are synchronized. This means that if updating several
times the event type you could end up with an XMas configuration with
lines coming from different event types, depending on their o2m configuration.

We choose a better heuristic that should solve this issue

  * every time we change type, independently of its use_* field that is used
    mainly for UX on the type itself:

    * erase existing lines that have not been used yet (no mail sent, no
      ticket linked to registrations, no answer linked to registrations)
    * create new lines based on old one; if type has no lines, event will
      have its old empty line erased as well;

It means that we try to synchronize more the type to the event while keeping
configuration line already used in some registrations.

Also provide some other fixes like deletion restrictions or better domain
for UX purpose. See sub commits for more details.

LINKS

Task ID 2244487
PR odoo/odoo#52998
FwdPort of odoo/odoo#52923

X-original-commit: 645f70cad033083e82a3ef9102c694c331badef9
Co-authored-by: Sebastien Mottet <oms@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-06-16 09:14:31 +00:00
Thibault Delavallée 7c37d457e7 [IMP] event: improve some type -> event configuration tests
Purpose of this commit is to add some tests related to event_type to event
configuration. Indeed changing a type on an event may change its sub models
(mails, tickets, questions). Asserting current behavior is necessary before
tweaking behavior considered as to be improved.

Task ID 2244487
PR odoo/odoo#52998
FwdPort of odoo/odoo#52923

X-original-commit: 6fb42e70164bab05681b11f1e76e320db0266445
2020-06-16 09:14:31 +00:00
Thibault Delavallée 83a7fb5f92 [IMP] event_sale: add some tests for registration update
In this commit we add some tests related to sale order / event registrations
synchronization, notably

  * registrations automatically created when _update_registrations of an SO
    line is called, for example at SO confirmation;
  * using the registration editor;

LINKS

Task ID 2258685
Prepare Task ID 2166679 (create leads from registrations)
PR odoo/odoo#51341
2020-05-18 11:58:06 +00:00
Thibault Delavallée d2840a0519 [FIX] event: include timezoned event date_end in registration open computation
Purpose of this commit is to try to lessen random conditions being concatenated
in templates by correctly computing event_registrations_open field that is
now correctly based on

  * event.date_end -> if event is done, registrations are not open anymore;
  * event.start_sale_date -> lowest start date of tickets (if any; start_sale_date
    is False if no ticket are defined, see _compute_start_sale_date);
  * any ticket is available for sale (seats available) if any;
  * seats are unlimited or seats are available;

Some better timezone computation is included even if it could be done better.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: a11af9074499465b6dd8ad1400e60c7af96e21c7
2020-04-03 11:07:55 +00:00
Thibault Delavallée 55c8367ce7 [IMP] event: add some test for is_ongoing with timezones
Rumors were heard of is_ongoing not working well. First try with playing
with timezones.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: d54faa336da29ff3167edb2331edd3e2508bc64f
2020-04-03 11:07:55 +00:00
Patrick Hoste d2e02976e2 [REF] (website_)event(_sale): change seats_availability field to seats_limited
PURPOSE

Change seats_availability selection field into a boolean field
and rename it to seats_limited for consistency.

SPECIFICATION

Change all the tests accordingly.

Task ID : 2198660
PR : #46659
2020-03-31 06:34:45 +00:00
Patrick Hoste aebe199d80 [IMP] (website_)event(_track): change event form view display
PURPOSE

Change the event form view to improve its usability and make it clearer.

SPECIFICATIONS

- Change some stats buttons icons
- Change order of the fields and put the range date field in second
place since it's a mandatory field.

LINKS

Task ID : 2198660
PR : #46659
2020-03-31 06:31:08 +00:00
Thibault Delavallée 45f32c5795 [REF] event: rename event type default_registration_max to seats_max
Purpose is to have matching names between event type and event to ease code
understanding.

LINKS

Task ID 2089156
Community PR odoo/odoo#42911
Upgrade PR odoo/upgrade#912
2020-03-10 11:15:10 +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
Patrick Hoste 8a6e6484ba [IMP] event: add some tests for is_ongoing field
Adds some python tests for the is_ongoing field and search filter.

LINKS

Task ID : 2190611
PR : #44651

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-02-26 10:55:11 +00:00
Patrick Hoste 1de3d44013 [IMP] event: remove seats_min and default_registration_min from event model
PURPOSE

This field is deprecated. Since its usage was to trigger a warning when
trying to confirm an event and confirming an event is not done anymore,
it has become obsolete.

SPECIFICATION

remove seats_min field and usage from event.event
remove default_registration_min field and usage from event.type

LINKS

Task ID : 2192652
PR : #44938
2020-02-18 14:14:46 +00:00
qmo-odoo b0ec3aa1eb [REF] event: remove twitter_hashtag and its configuration on event type
This commit removes the field twitter_hashtag from event and event_type.
The justification behind this change is that it has been made obsolete
by our social marketing app and our website builder.

Task ID 2191921
Community PR odoo/odoo#44715
Upgrade PR odoo/upgrade#764

Related: odoo/upgrade#764
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-02-11 14:36:52 +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
Thibault Delavallée f8e80cf47d [REF] event: improve ticket type / ticket event fields propagation
PURPOSE

This commit is part of ticket model support directly in event application.

SPECIFICATIONS 1: remove date fields from event.type.ticket

Coming from old ticket implementation there are several unused fields on
event.type.ticket, notably dates about selling. Indeed tickets defined on
event.type are templates and should not be time bound.

Previously those fields were available on event.type tickets but not propagated
to the event tickets. Now they are not available anymore, simplifying models.
We therefore remove them from event.type.ticket model.

SPECIFICATIONS 2: propagate seats definition from ticket template to tickets

Previously to the global feature this commit is a member of, only ticket name,
product and price were copied from event.type to its events. Description has
been added in a previous commit. In this commit we also propagate maximum
seats availability.

Use case is linked to event.type defining a recurring event in a given
location. As seats availability is known it can be copied on all events
linked to this event type.

SPECIFICATIONS 3: improve naming of event tickets

Before this commit, all tickets of an event were labeled the same way
by default, using simply ``<event_name>``. This is annoying when
having several tickets as they had all the same name.

In this commit we fix that behavior by setting the name

  * directly from the ticket template when tickets come from an event.type.
    Configuring Standard and VIP tickets on an event type will therefore
    give Standard and VIP tickets on event;
  * generic 'Registration for <event_name>' when adding manually a new ticket
    for an event;

LINKS

Task ID 2177281
Community PR #43488
2020-01-30 15:18:08 +00:00
Thibault Delavallée 6b09c1b8c6 [REF] event: move ticket definition from event_sale to event and use ticket templates
PURPOSE

Integration between event and eCommerce is required only when users handle the
entire selling process online. However users may require ticketing support
while managing payments outside of Odoo. Purpose of this commit is to support
tickets directly in event application without need of sales.

RATIONALE

Remove the need to have event_sale installed to manage basic multi ticket
event type. Integration with eCommerce is needed only when one wants to handle
the entire selling flow online, i.e. order, payment, ... Integration with
Sales is needed only when one wants to create sale orders linked to attendees.

Many event users do not need all of this. Their attendees pay through bank
transfers or they simply manage payments outside of Odoo while still
requiring tickets management.

SPECIFICATIONS

Remove the need to have event_sale installed to manage basic ticketing on
events.

Move ticket model (event.event.ticket) directly into event, copying most
fields from event_sale. Only sale specific fields and behavior should be kept
in event_sale :

  * keep product_id and price information in event_sale;
  * keep sales analysis in event_sale;

We also split tickets model used for event type (event.type.ticket) and
events (event.event.ticket). Indeed previously to this commit both are
modeled in the same table, with the following issues :

  * tickets on templates use only a subset of fields: name, seats availability,
    product, price;
  * a ticket has either an event_id, either an event_type_id, and there are
    constraints to try to avoid having lost tickets. This leads to a strange
    model where m2o fields are required only in some cases with a dual
    behavior;
  * tickets are not shared between event.type and event.event. They are copied
    and having a single model is therefore not necessary;

We therefore choose to have a light model for event.type.ticket. It is linked
to event.type when configuring template tickets. They are copied in the
onchange copying event template configuration to the event itself, leading
to event.event.ticket creation.

Some tests are moved / completed accordingly.

Access rights are copied from website_event_sale to website_even concerning
ticket access for public / portal. Currently they are kept as they are with
some rewording as it is not the purpose of this commit to rewrite them.

LINKS

Task ID 2177281
Community PR odoo/odoo#43488
2020-01-30 15:18:08 +00:00
Thibault Delavallée 7caa532341 [IMP] event(_sale): add some tests before updating models
As some event models (event.type and event.ticket notably) are about to
be modified let us add some tests to avoid regressions.

Security tests are also moved in their own file. Some internals tests defined
in event_sale are also moved in their own file. That way we avoid bloating
files with unrelated tests. Future commits will add tests for event and
event.type models.

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 3b1c2566ed [FIX] event: copy event type mail scheduling only if activated
Currently when changing category of an event, its category mail scheduling
is copied onto the event even if the category does not enforce its use.
We have to check the category use_mail_schedule field before computing
the new event mail schedulers.

In this commit we also lessen default schedulers from 3 to 2 in order to
still help people using them without bloating too much event creation.

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
Thibault Delavallée 5ee901dcb1 [IMP] (website_)event(_sale/_question/_track): clean and improve tests
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

Clean existing tests: lessen data / variables, try to remove unnecessary
tests or merge duplicates.

Add new tests, notably event type configuration copy onto event records
is not well tested. Event computed fields are also more tested.

Some access tests are added, more a base for future addition as only a few
use cases are covered.

LINKS

Side effect of Task ID 2089156 (event onchange to compute)
Community PR odoo/odoo#43127
Enterprise PR odoo/enterprise#7656
2020-01-10 13:24:25 +00:00