Commit Graph
339 Commits
Author SHA1 Message Date
Noe Antoine c0a68becb5 [IMP] event: add a lang field on event.
In order to allow all communication to be sent in
a chosen language, a 'lang' field is added on the
event.event model. If set (amongst the installed languages)
this language will be used to translate email templates
instead of the partner's one (which is still the default one)

The field is added on the event form view.

Task-3357099

closes odoo/odoo#127540

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-08-23 14:43:11 +02:00
althaf shaik f16b92a8af [FIX] event: handle error in res partner while evaluating static map url
This traceback raises when user click 'send by email' of 'event registration'.

Error: 'Expected singleton: res.partner(20, 19)'

On '_compute_static_map_url_is_valid' method self is referenced to get
'static_map_url'.
when self is having multiple records, it is used to get
'static_map_url', which leads to above traceback.
See:
https://github.com/odoo/odoo/blob/6f45bf0f496db37b28e8c4f8cc23b0eeec683c90/addons/event/models/res_partner.py#L32-L40
sentry-4359170170

closes odoo/odoo#132560

X-original-commit: 1da387373f772c487fa7391aa24be57b464bb5f3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-21 19:57:46 +02:00
Gorash 75a105f46a [REF] base/all: Update modifier syntax: remove 'states' from fields
These changes are made as a result of simplifying attrs and 'states' in
views. However, they should have remained in a separate commit. When
applying the script making the xml changes (used later for the migration
script), the script checked the definition of the python fields in order
to convert the information into a python expression. Therefore, this
commit is not applied when the script is applied to xml changes.

During this attribute deletion pre-existing errors were found. Part of
the code was using the boolean values of 'states' and another part of
the code was not. The behavior could therefore be different (in cases
where readonly on the field had the same value as the ballan in
'states').

Following the deletion of 'states' and without the application of the
view migration, the js tests (tower) were no longer functional. Tests
using the Form view suffered the same effect. There are few tests that
had to be adapted, including two tests in business accounting (updated
by the accounting team). A test for column_invisible did not work. Test
checking if the test system triggers an error if we try to write on an
invisible field. It turns out that Form was testing on the value of
invisible but not taking into account if the column was invisible. The
test system fix is applied separately because there were a lot of tests
that were incorrect.

Part-of: odoo/odoo#104741
2023-08-18 09:49:11 +02:00
Thibault Delavallée adfdf5ab33 [IMP] phone_validation: add a phone formatting tool on model
RATIONALE

Simplify field management for mail / phone / sms flows. Make it working out
of the box, easier to use and tweak.

SPECIFICATIONS

Add a '_phone_format' tool method on BaseModel. It allows to format a number
either directly, either from a field available on the model. It allows to
ease number formatting. It uses available helpers to find numbers using
'_phone_get_number_fields' and '_phone_get_country_field'. With default
generic behavior this allows to simplify most calls to phone number formatting.

Having it available at BaseModel level allows to remove some custom code,
calls to phone_validation API, ...

Task-3422449 (Mail, Phone: Move and improve field helpers)

Part-of: odoo/odoo#130468
2023-08-02 18:50:17 +02:00
william-andre 0479b2b594 [IMP] account,*: manage subsidiary companies
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models

These records can be read and used in children companies.

This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
  country

task-3371677

closes odoo/odoo#125642

Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-20 11:49:06 +02:00
Thibault Delavallée e2711f46ff [IMP] event: format mobile / phone number of attendees when possible
ISSUE

SMS reminders are not always correctly sent, as people fill form using local
numbers. When scheduler run the number is not always recognized to be
formatted using E164 format. We should try to normalize numbers when possible.

SPECIFICATIONS

Try a sanitize: format number based on event country (or partner if set).
If formatting it works, use the given number, otherwise use the original
number.

Do it at registration creation, as classic flow is the frontend where customers
give numbers used to create registrations. When the number is coming from the
partner through the compute, do not do anything and keep current behavior
which copies partner number if not given directly on the registration.

Add an onchange to try to format the number in the form view, like what is
done on leads. Do not automatically do it at write as it is not really
required currently from business point of view, it is more an helper for
frontend registration.

Task-3342820

closes odoo/odoo#128118

X-original-commit: 94fa8d962535a754c9fb26997a38cc8b51b8974e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-12 12:38:48 +02:00
Rémy Voet (ryv) c5cb357d90 [IMP] *: add dependencies to display_name field
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).

Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.

closes odoo/odoo#122085

Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-28 17:41:19 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
Saurabh Choraria 93b7463113 [FIX] event_sms: check model of sms template
When notification type is set as sms we need to check whether the template
which is referenced is coming from a correct model or not.

Applying this commit will fix this issue.

sentry-4195133685

closes odoo/odoo#125831

X-original-commit: 745bcab5ee524ae1c42e5773a86b15ef3a7019d3
Related: odoo/enterprise#42882
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-06-21 06:57:53 +02:00
Nasreddin Boulif (bon) 7359b47a81 [FIX] event[_sms]: send emails direclty after attendee confirmation
Steps to reproduce:

  - Install `Events` module
  - Create a new event and set it to `Autoconfirmation`
  - Create a new attendee and confirm it

Issue:

  Mail that confirm registration is not sent to attendee.

Cause:

  When computing the `schedule_date`, it take the value of the
  `registration_id.create_date` WITH the microseconds.

  When creating a new attendee, at some point we run the mail schdelure
  that compare if the `schedule_date <= now`.
  `schedule_date` and `now` have same value except for the microseconds
  (set on `schedule_date` but not on `now`).
  Therefore `schedule_date > now` and the mail is not sent.

Solution:

  Remove microseconds from the schedule_date.

opw-3079389

closes odoo/odoo#122188

X-original-commit: f2adca45dcec5a11daa92d07bae00615210ea0de
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-05-24 17:05:46 +02:00
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