Commit Graph
329 Commits
Author SHA1 Message Date
Patrick Hoste 6b8daa880c [IMP] website_event(_sale): adds new identification questions
This commit changes the way the identification questions (name,
email, phone) are asked when registering to an event. They aren't
hardcoded anymore and can be created per event the same way other
questions can be. They can be set as mandatory or not and the order
can be changed. One can now also ask for the attendee company name.

Task-3056380

closes odoo/odoo#112164

Related: odoo/upgrade#4313
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-05-12 21:50:44 +02:00
Patrick Hoste cc60fcd45c [MOV] website_event(_crm)_questions: move event questions code
This commit moves the code from website_event_questions to
website_event and from website_event_crm_questions to
website_event_crm module.

Task-3056380

Part-of: odoo/odoo#112164
2023-05-12 21:50:44 +02:00
Ivan Yelizariev 547274edd1 [FIX] event: properly handle non-existent template
This commit modifies `execute` method to avoid `MissingError` on reading
`template_ref` field.

`template_ref` is a Reference field, which may have id of a deleted record.

https://github.com/odoo/odoo/blob/927890d0178c361ef8d80fe6a1ec2ffaefaf73fd/addons/event/models/event_mail.py#L53

Method `execute` is used by cron.

https://github.com/odoo/odoo/blob/fba13477843d4d36e3e7a9ddd4b0812c9726e20c/addons/event/data/ir_cron_data.xml#L4-L8
https://github.com/odoo/odoo/blob/927890d0178c361ef8d80fe6a1ec2ffaefaf73fd/addons/event/models/event_mail.py#L247-L256

Getting the `MissingError` means blocking processing the whole batch of tickets.

Fix it by ignoring such tickets and logging a warning

https://online.sentry.io/issues/4089773378

closes odoo/odoo#121199

X-original-commit: c61a8fbb7d4338ca362a3d2093e7aa2f973b289c
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-05-12 19:55:10 +02:00
Rémy Voet (ryv) 302c7baa87 [REM] core,*: remove name_get_uid parameter from _name_search.
`name_get_uid` is unused (at least since v14) and the
documentation about it, is wrong.

closes odoo/odoo#117819

Related: odoo/enterprise#39483
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-04-28 16:04:27 +02:00
D J 50d6f18250 [IMP] website_event: consider address while searching events
Currently, website users/visitors are not able to search the events based on
where they happen.

This commit improves the behavior by allowing the users/visitors to type the
city/country name in the search box and returns the events that are happening
in the country or city that matches the search term. To allow this, we have
utilized the search_extra search option and searching the matching events
with sudo because public users can not access the address_search m2o of the
event. Apart from that, this commit also adds the ability to address_search
the event based on location (name) of the address on address_search.

Note that searching with sudo is just to add event ids in the domain. The final
result will be returned with non sudoed environment and so the record rules are
always respected.

TaskId-2791031

Part-of: odoo/odoo#89796
2023-04-05 09:42:23 +02:00
Hansun (hale) 6a54992575 [FIX] event{._sms}: event: access right for admins of event app
1. Install [Events]

2. On [Settings], create an admin for Events (uncheck all other rights)

3. Click on Events, enter an event

3. Click on [Communication] tab, and try adding a line

Issue: accessing ir.model is blocked
Solution: Find another way

Original fix in 15.0: #112527
Fix of the fix in 15.0: #115881
Original forward-port in 16.0: #115101

This commit is fixing the original forward-port in 16.0 and includes
the fix of the fix.

affected branch: 16.0-master
opw-3163138, 3193659

closes odoo/odoo#116438

X-original-commit: 38594f13586d95c8ed74593ea368e8b51826740b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-24 07:45:15 +01:00
Hansun (hale) 5f6c758adb [FIX] event{._sms}: access right for admins of event app
1. Install [Events]

2. On [Settings], create an admin for Events (uncheck all other rights)

3. Click on Events, enter an event

3. Click on [Communication] tab, and try adding a line

Issue: accessing ir.model is blocked

Solution: Find another way

Impacted versions: 15 - master

opw-3163138, 3103199, 3193659

closes odoo/odoo#115237

X-original-commit: db37a4e230f8cd6ac916fe3a21aea5ff43c61d53
Related: odoo/enterprise#38169
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-14 19:39:09 +01:00
Raphael Collet c161177cb7 [IMP] core: _name_search() now takes explicit order and limit parameters
This API is much more sensible for making subqueries.  Specifically, one
can generate a subquery without the clauses LIMIT and ORDER BY.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
Raphael Collet 136eb34f07 [IMP] core: _search() no longer uses a default order
This simplifies the use of subqueries by avoiding some costly default
order on the model or the idiotic order='id'.  Method _flush_search()
has been adapted accordingly.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
miad-odoo f1cb5e6b39 [FIX] event: make scheduler respect mail template
Before this commit, the mail scheduler in event bypassed the email_from field
in the selected template, implementing instead its own logic.

With this commit, the scheduler respects the `email_from` field from the mail
template, and only implements its own logic if that field is not set.

Task-3092425

closes odoo/odoo#111462

X-original-commit: ef503e62480c774e8a0d193666cc4cce5ab90282
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-31 15:17:55 +01:00
Renaud Thiry 1348509668 [IMP] event: add setting menu for g-map API key
Add some setting buttons for users to configure their API keys in events

task-3079113

Part-of: odoo/odoo#107200
2023-01-20 19:56:52 +01:00
Renaud Thiry 83e4551492 [FIX] event: add signed static maps api
Google now requires an API key for the static maps API.
As API calls cost money, and we cannot restrict the domain of the caller
with the API key in emails, as the domain may vary vastly,
the signing of static API URLs is implemented in the existing
'google_map_img' of partners.

This in turn can be used to get a url for an existing location.
While preventing anyone from stealing the API key for their own purposes

task - 3079113

Part-of: odoo/odoo#107200
2023-01-20 19:56:52 +01:00
Thibault Delavallée 1a1acabd7b [REF] mail: cleanup mono/multi record composer behavior
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Support a real res_ids field on mail.compose.message model. Instead of relying
on active_ids from context, store it once for all at composer level and use
it in code. Active_ids usage is still done at default_get level, using it to
populate the field.

Improve usage of domain, renamed to res_domain to match other document related
fields naming. Add support of a res_domain_user_id field allowing to set the
user from which the domain should be evaluated.

Composer now runs on a list of IDs. Mass mail mode and comment mode are now
distinct from running on a singleton or on more records. Rendered or raw
mode is not triggered by

  * mass mailing mode: always display raw mode, whatever the number of records;
  * comment mode: display rendered mode when having a single record (like the
    previous comment mode). Display raw mode when having either no records
    either at least two records.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:39 +01:00
Renaud Thiry f039f57eb8 [IMP] Add more detailed default email subjects from chatter
All emails sent from the chatter start with "Re:" followed
by the name of the record. The name of the record alone is sometimes not enough for
the followers to understand what the mail is about.
Additionally, "Re:" does not make sense when starting a conversation.

This commit gives better default subject
for event registrations and allows thread models
to override the default subject of messages.

This also removes "Re:" from default mail subjects.

Task-2833215

closes odoo/odoo#95817

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-01-05 15:36:53 +01:00
Pratik Raval a0a6171378 [IMP] event*: move event type data to demo
* = event, event_booth, website_event_questions

We used to provide data for the event templates (event.type) to provide a basic
configuration to play with. However, they are not much helpful, and sometimes
can confuse the users.

This commit removes the data records for the event templates, and on the
m2o field on event, now we let users create/edit them on the fly so that
they can explore the feature by themselves.

We have also added demo data to the 'Exhibition' and 'Sport' templates,
having booths and questions, respectively. Along with that, we have added
relevant data to the demo events where both templates were used; and set
auto-confirm to be false by default when creating a new event template.

taskID-2854123

closes odoo/odoo#99421

Related: odoo/upgrade#3849
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-02 12:56:21 +01:00
Noe Antoine a340443177 [IMP] event{_sale}: add sequence to tickets (and templates)
When the price and the event are the same, nothing allows
ordering tickets in event_sale. Therefore, add a sequence
number and handle widget to the tickets (in data as well).
Also do it for ticket templates. Also, order the tickets
(on events and templates) by name before id.

Since event type tickets are not linked to any event, the
order does not include the event_id. However, event event
tickets are, and if they appear in the same list / reporting
someday, it makes sense to order them by event_id first.

In event_sale, we make sure the price is also in the order.
As the price is in the copied fields on the event when
using an event template, we add the price on the event
type tickets ordering to align with the event event tickets.

Add default value to sequence and sequence number to data
for event.type model. They were sequenced but demo data had
none, hence not really ordered.

We also add the id in the event.event _order value, otherwise
when ordering on the event (for instance ordering on event_id
for event.event.tickets), the order is random for events
having the same date_begin. We prevent this from happening.

Also make description optional hide on event types.

Task-2997391

closes odoo/odoo#101384

Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
2022-11-17 14:56:42 +01:00
Jérémy Hennecart (jeh) 4fa73dc531 [IMP] website_event: round default datetime
Add default date_begin and date_end when creating an event.
To avoid having weird time (like 11:23) we round date_begin
to the nearest 30 minutes range and the date_end is set to
the next day of date_begin.

So for example if now is "2022-06-30 10:12" then:
date_begin = "2022-06-30 10:30" and date_end = "2022-07-01 10:30"

task-2845417

Part-of: odoo/odoo#91883
2022-09-06 22:31:04 +02:00
Umesh Gupta e8949d9f79 [IMP] event: prevent communication line duplication on an event
Currently, when we change the event template, all the communication
lines linked with are added to the event. That means, even if some of
the lines are sent, and if the new templates lines that has exact same
configuration than the sent ones, they are still added to the event,
which means the same mails will be sent again to the attendees.

With this commit, we check that the communication line being added
(as a result of template change) has the same configuration against
any of the already sent one, it is skipped. As a result, attendees
will not be spammed with the same emails.

taskID-2811310

closes odoo/odoo#89961

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-16 16:27:52 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Miquel Raïch 055f95ddfe [IMP] event: use UserError in search method instead of ValueError
In a search method, the error comes from the user and thus the error should be an UserError. ValueError should be used for other cases.

closes odoo/odoo#93944

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-27 15:11:09 +02:00
Ivàn Todorovich db45e228a8 [FIX] event: do not fail if mail.template is missing
Steps to reproduce:

1. Delete the mail.template "Event: Registration Badge".
2. Go to any event.registration record.
3. Click on Send by Mail button.

closes odoo/odoo#93090

X-original-commit: 373a838d2df05b8be9a89a933b291492ba6052f0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-08 15:46:08 +02:00
Patrick Hoste 312c4a5218 [FIX] event: fix address search
Fix commit : https://github.com/odoo/odoo/commit/b309200de582b388b35314512b4cbcd5316760c0
by changing address_seach field from related to computed.

Task-2810400

closes odoo/odoo#92789

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-02 16:54:37 +02:00
Florian Charlier a0e7f69513 [IMP] event{,_sale}: unstore seat fields
With stored computed seat attributes, the database can be flooded with update
queries for the stored values for the event (ticket) seats computations (such
as reserved, expected, and available seats).
This can especially occur when a communication is sent to many people about
an event with a registration link, many users may want to register at the same
time, possibly resulting in concurrent_update errors.

In this commit, we remove the `store=True` attribute of those fields, and
therefore remove the Reporting/Event feature depending on them and rewrite some
domain searches and _compute fields in the event and event_sale modules.

This also impacts the way constraints are enforced on the number of
registrations vs defined maximum as no stored value is directly available.

For performance reasons, all events and tickets are now shown on backend form
views, with seat availability added in their displayed name.

Misc
To avoid delaying the inevitable, the Event configurator modal/wizard now
validates event/ticket consistency at closing.

The UI of the RegistrationEditor wizard is also improved:
* A warning alert will tell users that free registrations were not confirmed
because of insufficient seat availability.
* A first step to better explain the consequences of the actions taken on the
modal was to be taken, here via the description and buttons wording.

Tests
Query counts are (indeed reduced) and updated. However, as local testing with
`test-tags=/test_event_full` ("tef_only") is currently not reliable, these
values were updated by applying the same change from the commit as the one seen
for the runbots, while a "?" is appended to show this uncertainty.

Task-2654816
See odoo/upgrade#3118

Part-of: odoo/odoo#81583
2022-05-31 13:57:24 +02:00
Patrick Hoste b309200de5 [IMP] event: allows filtering event on address
PURPOSE

This commit allows one to filter the events based on its address

LINKS

Task-2810400

closes odoo/odoo#87678

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-31 12:51:50 +02:00
Raphael Collet 6cf8db906f [REF] *: adapt code to new flush API
closes odoo/odoo#87527

Related: odoo/upgrade#3497
Related: odoo/enterprise#26939
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-05-25 18:00:47 +02:00
Christophe Monniez 65c8814a2f [FIX] various: replace deprecated currentThread method
CurrentThread is now really deprecated in Python 3.10 ... Time to
change.

Part-of: odoo/odoo#91927
2022-05-23 08:29:52 +02:00
Pierre-Yves Dufays 909d577918 [IMP] event: eases registration follow-up
Globally ease event registrations followup by improving the related search
views and by allowing a quick access to statistics.

Specifications:

1) A stat button has been added on event that go to attendee reporting filtered
on the event

2.a) in the attendee reporting, the text search has been modified as follows:
- order: first search on event
- order + added: then search on responsible
- order + added: then search on organizer
- order: then search on participant
- then other field already present

2.b) still in the attendee reporting, filter "archived" has been moved as the
last filter

2.c) still in the attendee reporting, group by for campaign, medium and source
have been added

3) link to confirmed and expected attendee in the kanban view box now redirect
to the new stat view with the suitable filter

Technical remarks:
- view for a specific event launched from the event view uses a specific
search view which doesn't include search on event (name, organizer, ...).

Task 2761011

Part-of: odoo/odoo#84546
2022-04-29 11:00:50 +02:00
Pierre-Yves Dufays 5717543b04 [FIX] event: fix event description edition (leak from one to another)
When saving a description the one edited doesn't appear but the one edited
previously instead. This fixes this problem.

Technical note: the default description for a new event was the rendering of
a template. That template was shared between all the events and overridden each
time.
The solution was to strip the identity of the template while rendering it
making it a constant and preventing it from being shared between events.
This could be done by setting rendering_bundle to True in the rendering context
(unfortunately, t-ignore is not a legitimate attributes of template tag).

Note that the same fix [1] was done on `website_hr_recruitment`.

[1]: https://github.com/odoo/odoo/commit/f1ee633f26a78636fede3e2b600c801b5f474a50

Task-2781443

closes odoo/odoo#89520

X-original-commit: 5e8be9024b8fd1cdd7caf3cb711861a4a7bee2c8
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-04-24 13:05:08 +02:00
Xavier-Do f50162162c [FIX] crm: used cr date for date_closed
This is mainly here to avoid future randomness on tests and have a
coherent value with previous commits

Part-of: odoo/odoo#85525
2022-04-04 16:48:17 +02:00
Florian Charlier f0e1e60528 [IMP] {*_,,}event{,,_sms}: update sms reminder template
* = website

Change the wording of the sms reminder template to make it sound friendlier and
more complete. The sms will include the event address if it is defined.
Otherwise, it will link to the event page if website is installed.

A one line-formatted version of the venue is added to the model to be used in
the template and other places.

This required to update `event_registration.get_date_range_str` to not include
the time when describing an event happening more than a month from the current
date, which makes sense as there is no reason to specify the time only in that
case, and we add the time somewhere else when it's useful anyway.

For consistency, Wembley Stadium is updated to London timezone in the demo
data.

Task-2777183

closes odoo/odoo#85664

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-01 17:56:24 +02:00
Jérémy Hennecart (jeh) d4780b756d [IMP] website_event: display the timezone when a datetime is used
Cleanup all the places where an hour or a datetime is been used
to display with the date the corresponding timezone.
The goal is to know the timezone used where a datetime is displayed
on the event pages.

task-2458013
COM PR: odoo#78049

Part-of: odoo/odoo#78049
2022-03-23 20:18:34 +01:00
Rémy Voet (ryv) e1785e820a [IMP] base: add prefetching group feature
The field prefetching mechanism was poorly customizable.  Before this,
we could only tell if a field was prefetched with other fields or not at
all.  We have no way to inform the framework, like: "When I need data of
that field, prefetch these other fields, which are likely be used in the
same transaction".

From now on, the `prefetch` attribute is used as a grouping key for
prefetching fields.  When a field is fetched, all the fields with the
same value for `prefetch` are taken for prefetching.

For example, consider a small set of fields that are rarely used, except
for one flow A using them.  You want to prefetch those fields only in
the flow A, and you want to fetch them in a single query.  With the new
feature, simply set `prefetch=A` for some string `A` on those fields,
and they will be grouped for prefetching.

closes odoo/odoo#85220

Signed-off-by: Rémy Voet <ryv@odoo.com>
2022-03-03 11:03:55 +00:00
Julien Castiaux 66a3a409eb Revert "[FIX] event: remove prefetch=True"
This reverts commit 8dda03228e.

Part-of: odoo/odoo#85199
2022-02-23 12:59:52 +00:00
Julien Castiaux e655e8da8a Revert "[IMP] base: add prefetching group feature"
This reverts commit 041fe5e21e.

Part-of: odoo/odoo#85199
2022-02-23 12:59:52 +00:00
Rémy Voet (ryv) 041fe5e21e [IMP] base: add prefetching group feature
The field prefetching mechanism was poorly customizable.  Before this,
we could only tell if a field was prefetched with other fields or not at
all.  We have no way to inform the framework, like: "When I need data of
that field, prefetch these other fields, which are likely be used in the
same transaction".

From now on, the `prefetch` attribute is used as a grouping key for
prefetching fields.  When a field is fetched, all the fields with the
same value for `prefetch` are taken for prefetching.

For example, consider a small set of fields that are rarely used, except
for one flow A using them.  You want to prefetch those fields only in
the flow A, and you want to fetch them in a single query.  With the new
feature, simply set `prefetch=A` for some string `A` on those fields,
and they will be grouped for prefetching.

Part-of: odoo/odoo#83818
2022-02-23 10:01:59 +00:00
Rémy Voet (ryv) 8dda03228e [FIX] event: remove prefetch=True
Remove `prefetch=True` on fields `legend_blocked`, `legend_done` and
`legend_normal`, because they aren't used a lot and translated fields
have a big cost to fetch (one extra LEFT JOIN by translated field).

Part-of: odoo/odoo#83818
2022-02-23 10:01:59 +00:00
Patrick Hoste b74ed97482 [IMP] event: order event tags by category sequence / own sequence
PURPOSE

Before this commit the tags were ordered only by their own sequence
making the display quite random when several tags had the same
sequence but belonged to different categories.
After this commit the tags are ordered by their category sequence
followed by their own sequence.

LINKS

Task-2737156
Closes: odoo/odoo#83082
2022-02-22 15:19:23 +00:00
Raphael Collet a1904aa6f6 [IMP] core: field index names
The possible index names have been renamed "btree", "btree_not_null"
(instead of "not null") and "trigram" (instead of "gin").

Task 2742526

Part-of: odoo/odoo#83274
2022-01-28 14:10:01 +00:00
Rémy Voet (ryv) 5a573c6f18 [IMP] base: don't prefetch translate field by default
Issue
-----
Via the field prefetch mechanism, when we need a value of one field
(not in cache of course), the ORM will prefetch all fields
(which has the attribute to `prefetch=True`, the default value of this
attribute is `True`) for all record ids in `_prefetch_ids`.
Then, for each translate fields (where translate is not a callable)
the ORM need to make a `LEFT JOIN` on the `ir_translation` to fetch the
translated value. For big model, it leads to a simple `SELECT` with
several `LEFT JOIN` on ir_translation but each LEFT JOIN have a cost
in the planner time (a small cost in the execution time) of PostgreSQL.

By example, for `product.template` (stock/sale/purchase installed),
there are 6 LEFT JOIN to get all translated fields (5 of this
fields are rarely used).

Proposed solution
-----------------
Deactivate the prefetch by default for all translate fields expect if
this field is the `_rec_name` of the model (which is more likely to
be used).

In the example on the `product.template`:
Without prefetching the translated fields, there is only one LEFT JOIN
(the name, which is translated but is the `_rec_name` of the model).
With the 6 translated fields to fetch, the
query takes 5 ms to plan and 2 ms to execute VS with 1 translate field,
it 1 ms to plan and 1.5 ms to execute.

Side change note
----------------
- All translate of fields of `website.seo.metadata` should be prefetch
to avoid lot of website errors (it is because, website put in cache data
in sudo before reading it without sudo)
- `description` (`mail.message.subtype`), `subject` (`mail.template`),
`body_html` (`mail.template`) should be prefetch to avoid lot of extra
query from mail module.
- `vat_label` (`res.country`) should be prefetch to avoid a extra query
for each website page.
- Increase some queryCount (when it is legit, due to `subtitle` of
`blog_post` or `description` of `event.type.ticket`, etc)

task-2738029

closes odoo/odoo#82896

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-01-28 14:09:56 +00:00
Fabien Pinckaers eedf37d6e2 [IMP] Better handling of indexes
Three supported types:
- btree (default for index=True)
- btree not null (when >90% of the data are null)
- gin trigram search (for char fields)

Review of indexes on all objects.

closes odoo/odoo#83015

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-01-19 16:52:23 +00:00
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 7ef380fe34 [IMP] event: add precompute to remove create hook
On event model, seats_limited and date_tz are required but are editable stored
fields. An override of create has been added to ensure they have a value as
compute are called after creation which leads to required not being satisfied.

Now that precompute [1] is available this code can be safely replaced.

Performance tests (not yet merged [2]) indicate this has no impact on queries.
What was done manually before this commit is now done directly by the ORM.

[1] odoo/odoo@d04a5b5c8c
[2] odoo/odoo#81068

Task-2702872 (Event precompute)

closes odoo/odoo#80672

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-12-08 15:36:51 +00:00
ijas ahammed 8c8c757869 [IMP] event,website_event: improve attendees form view
In this commit we have changed some order of fields in
attendees form view, changes are listed below,

 - moved `partner_id` field next to `event_ticket_id` and
   made this field editable and trackable, this change had done because
   currently this is the first field you see and it currently
   looks like this is the person that's coming.

 - moved `visitor_id` field below `mobile` field, so that even
   in debug mode, Attendee Name is the "primary" field.

Apart from that right now if there are attendee data (name/email/phone)
and when we update the partner_id these attendee data will be erased
and updated as the new partner's information.

In this commit we are improving this, if there is any attendee data
it will not get erased while partner_id is updated. Attendee data
will get updated only if name/email/phone fields are empty.

TaskID-2670765

Part-of: odoo/odoo#79166
2021-11-30 12:52:16 +00:00
ijas ahammed 0900675903 [IMP] event: remove the date_open field
In this commit we have removed the `date_open`
field from the model `event.registration` as it
is a duplicate of the `create_date`.

TaskID-2670765

Part-of: odoo/odoo#79166
2021-11-30 12:52:16 +00:00
Thibault Delavallée 3659546738 [IMP] mail, various: support email notification xmlid at model level in composer
RATIONALE

Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.

SPECIFICATIONS

Get rid of context usage (``custom_layout``) and use a real field on composer
model: ``email_layout_xmlid``. Use now a default value coming from context
(default_email_layout_xmlid) instead of custom_layout.

Support old context key in composer for backward compatibility, working like
a default value for the field itself.

Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)
UPG odoo/upgrade#2829

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Martin Trigaux 8ae1a43663 [FIX] base: correct evaluation context for report rendering
Fix of 57665a02f7b4 which was problematic in point_of_sale
2021-01-19 11:09:41 +01:00
Fabio Barbero 44e5f0cd2c [IMP] event_*, website_event_*: improve UI
Purpose
=======
Give the user a better experience when handling events by removing
useless views and using coherent names of fields.

Specifications
==============
Add placeholders in multiple fields, change names in event_event module
to be more consistent with each other, remove and add filters/measures
in events and tracks.

Task-2646692

closes odoo/odoo#77389

Related: odoo/enterprise#21294
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-26 19:40:39 +00:00
Fabio Barbero d713e6341e [FIX] event: stop sending confirmation email as public user
Purpose
=======
Fix guest users receiving confirmation emails for events by "Public User".

Specifications
==============
Confirmation emails for events are sent by:

- Organizer (if set)
- Company email (if set)
- The users's email
- Odoo bot otherwise

Task-2657588

closes odoo/odoo#78946

X-original-commit: 45c22f32e97479af2adb5958b75ded32c41d80e8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-26 13:22:52 +00:00
Nathan Marotte (nama) 07adca3c69 [FW][FIX] event : Changing seats_max could desync seates_reserved
Issue: Sometimes, when changing the Maximum (seats_max) on one of
the tickets of an event, it triggered a recompute for the other tickets

Steps to reproduce :

Install Events
Settings > Event > Enable "Tickets"
Create an event template (or use Sell Online default one) with
Check "Ticketing" and set the line price to 0
Create an event :
with that template
and Autoconfirm checked
Add a line for the Tickets:
name: VIP
price: 10
Save the event

Create two attendees for the event, one for each
Event Ticket (event_ticket_id) and confirm them (on the form, not
Confirm Attendee)

Change the Maximum (seats_max) of one ticket and save
-> the Confirmed (seats_reserved) will be recomputed but the
confirmed for the other ticket will increase as well

Side-Note:
I haven't been able to find a deterministic way to reproduce the bug
but it seems that the bug appear the most when doing all the steps at
once, and trying to not log out or refresh the page.
Also it works best on a runbot or at least with runbot data.

Without my modification, the new test passes on my local odoo server,
but fails on a dump of a runbot on my computer, adding my modification
makes it work on either case

Why is that a bug:
The recomputation seems to fail for some reason, we are setting all
the event/ticket in self to 0, but only update the value of those by
fetching a SQL query so there might be a desync there

opw-2642555

closes odoo/odoo#78023

Forward-port-of: #76492
X-original-commit: f4c936c9dc141de27a77006fb87dd2b63d88ec97
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Nathan Marotte <nmarotte@users.noreply.github.com>
2021-10-08 07:20:01 +00:00
Thibault DelavalléeandVictor Feyens 2f4d582a79 [IMP] event(_*): limit usage of search
Purpose of this commit is to globally improve code performance by limiting
search impact by

  * adding limits when only first found record id used;
  * avoid unnecessary searches when record set can be filtered instead;

Task-2638444
PR odoo/odoo#76005

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Victor Feyens <vfe@odoo.com>
2021-09-08 07:56:03 +00:00