Commit Graph
100 Commits
Author SHA1 Message Date
Louis Wicket (wil) cc541f9935 [FIX] tools: properly export all translated attributes
Prior to this commit, some attributes such as "data-tooltip" were not
exported in /static/src/ templates, while "label" was only exported in
them.

This commit adjusts the code to use the same list of translated
attributes everywhere, fixing the problem and making it less likely to
happen again.

Task-3872895

closes odoo/odoo#162250

X-original-commit: 6c272a432cea29fa98d9f2a3e4f454214099f3e6
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-04-18 15:05:29 +00:00
Louis Wicket (wil) 7e2f321b6a [I18N] l10n_es: update translations
closes odoo/odoo#157759

Related: odoo/enterprise#58700
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-03-15 05:02:59 +00:00
Louis (wil) 8d0a400d86 [FIX] tools: do not export slot params for translation
Slot params are dynamic content, similar to props, and are not
translated.

There is no point in adding untranslated content to the .pot files; so
this commit prevents the content of slot params from being exported for
translation.

Task-3718993.

closes odoo/odoo#152606

X-original-commit: b839faf09be259ffdccf9d872e646e4ebe4a8bcb
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-02-03 11:02:11 +00:00
Louis (wil) 34b81203da [FIX] sale: make "Down payment invoice" translatable
Nested gettexts aren't exported. This commit solves the problem by
moving the inner gettext outside of the arguments of the first gettext.

closes odoo/odoo#149921

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2024-01-19 21:25:46 +00:00
Louis (wil) aa523cf060 [I18N] stock: properly escape apostrophe in FR translation
Fix done directly on Github to not have to wait for the weekly sync.
Already corrected on Transifex.

closes odoo/odoo#149544

X-original-commit: 1a0bee8af2b28987a631c84311227ebd55ec632a
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-01-16 16:42:05 +00:00
Louis (wil) 13bb9c21ab [FIX] *: remove escaped newlines from translated strings
The parser of the library we use to extract strings to be translated
(python-babel) doesn't handle escaped newlines in the same way as the
JavaScript parser. The resulting mismatch makes the content that uses
them untranslatable.

for example:
```js
const hey = _t("slt \
çv ?"
);
```
is exported as "slt \nçv ?", while the content of the variable is
"slt çv?"

This commit removes faulty occurrences from the code base and re-exports
the corresponding POT files.

*: point_of_sale, pos_sale, project, web

closes odoo/odoo#145971

Related: odoo/enterprise#52617
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-01-10 15:26:01 +00:00
Louis (wil) ed6ab2a698 [I18N] l10n_din5008: update German translations
closes odoo/odoo#148632

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-01-10 08:50:53 +00:00
Louis (wil) ddbad879d5 [I18N] l10n_cz: translate the module to Czech
closes odoo/odoo#146683

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-12-18 23:32:07 +00:00
Louis (wil) e1570d82bf [I18N] l10n_mx_*: update translations
closes odoo/odoo#145012

Related: odoo/enterprise#52141
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-12-05 22:40:42 +00:00
Louis (wil) 357cbb8bd0 [I18N] website_sale: update Russian translation
opw-3608438

closes odoo/odoo#144483

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-12-01 14:23:47 +00:00
Louis (wil) 2b7f88004d [FIX] base: correct wrong translation
'field' is the name of a variable and shouldn't be translated

closes odoo/odoo#143441

X-original-commit: 52ce28f8c2e7998e247d3291e57ddd1ca3d604b9
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-30 07:37:07 +00:00
Louis (wil) b4b4842718 [I18N] web: remove unfortunate wording
Administrators sometimes machine-translate Odoo into their own language.
In this respect, we should avoid ambiguous wording* that could be poorly
machine-translated.

\*: in this case, the onomatopoeia "Poof!" was misinterpreted by a
machine-translation as a British slur.

opw-3590503

closes odoo/odoo#141723

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-11-10 21:23:24 +00:00
Louis (wil) b6b093b06f [I18N] base: fix bad translations
closes odoo/odoo#141704

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-10 08:31:43 +00:00
Louis (wil) 68b4dfc2bb [I18N] *: import translations
closes odoo/odoo#141655

Related: odoo/enterprise#50484
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-08 20:48:14 +00:00
Louis (wil) af5a5f4986 [I18N] *: export source terms
closes odoo/odoo#141127

Related: odoo/enterprise#50247
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-06 16:55:41 +00:00
Louis (wil) 548198ed2b [FIX] base_automation, website_sale_wishlist: correct typos
Corrects typos found when translating Odoo 17.

closes odoo/odoo#140627

Related: odoo/enterprise#49981
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-03 16:43:31 +00:00
Louis (wil) a46c800d53 [I18N] *: export source terms
closes odoo/odoo#140529

Related: odoo/enterprise#49925
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-31 15:54:32 +00:00
Louis (wil) 48ee45d6ce [FIX] *: fix typos
Corrects typos found when translating Odoo 17.

* : hr_fleet, payment

closes odoo/odoo#140282

Related: odoo/enterprise#49831
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-30 16:41:49 +00:00
Louis (wil) 83ffd5353e [I18N] update translations of BR localizations
closes odoo/odoo#139947

X-original-commit: b0582b4fbc7661805ea3909e939f3e05e99b6eae
Related: odoo/enterprise#49662
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 14:21:59 +00:00
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
Louis (wil) 6ba2972b4f [I18N] l10n_din5008_sale: change Verkaufsauftrag to Auftragsbestätigung
closes odoo/odoo#138671

X-original-commit: ca7b21cdd3078a9f6bd981dcd1281ecb6d59ff4f
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-14 03:27:09 +00:00
Louis Wicket (wil) a9ca779a1f [IMP] mail: voip refactoring
Adds useful fields to models needed for VoIP to work.

closes odoo/odoo#115689

Related: odoo/enterprise#38339
Related: odoo/upgrade#5021
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-10 01:59:33 +00:00
Louis Wicket (wil) 4adaeabc22 [I18N] fleet: replace “immatriculation” with “registration”
The word “immatriculation” doesn't exist in English.
This commit replaces its occurrences with “registration”.

closes odoo/odoo#137755

X-original-commit: 740979ef152f5cc89682004f9453a03e565bf6ec
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-09 13:25:38 +00:00
Louis Wicket (wil) 8e4aa704c6 [REM] website_event_questions: remove useless directory
The module has been deleted, but the i18n directory is still there.
This commit removes it.

closes odoo/odoo#137079

X-original-commit: 603b9c6bf861c330eb28a15c095bba67483c1398
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-29 11:59:04 +00:00
Louis Wicket (wil) 99af68bd2d [I18N] payment_stripe: reexport translations
Some strings are missing in the pot file and are therefore not
translated. This commit updates the pot file to the latest changes.

closes odoo/odoo#134039

X-original-commit: 22045d368a7beb72dc5330054dfa201c3c047e6f
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-09-08 11:12:38 +00:00
Louis Wicket (wil) 1276f53229 [I18N] l10n_es_edi_tbai: add Spanish translation
closes odoo/odoo#132914

X-original-commit: b752ca37957b1d37d882111816a4c88993457901
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-08-24 20:03:28 +02:00
Louis Wicket (wil) 75c69aeb38 [IMP] account, web_editor, base: remove useless use strict
According to the ECMAScript 2023 Language Specification:
> Module code is always strict mode code.

Odoo Modules mimic this behavior and automatically add “use strict“ at
the top of the file, so there's no need to do it yourself.

This commit removes all the useless occurrences of use strict.

closes odoo/odoo#132235

Related: odoo/enterprise#45908
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-08-17 19:51:17 +02:00
Louis Wicket (wil) 537b0ce712 [REM] base, *: remove binary_field_real_user from context
Formerly, using sudo() on a record had the effect of replacing the
current user with the superuser. But sometimes, knowing who the "real
user" was was necessary, so we needed to store it somewhere. This is
basically why the key `binary_field_real_user` was introduced in the
context: to keep track of who the user was before switching to sudo
mode.

Since 1e6c3bec2c, however, switching to
sudo mode no longer changes the current user; meaning that the
`binary_field_real_user` is no longer necessary.

This commit removes the remaining occurrences of the now useless
`binary_field_real_user` from the code.

* = hr, portal, web_editor

closes odoo/odoo#92032

Enterprise: https://github.com/odoo/enterprise/pull/27649
Related: odoo/enterprise#27649
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-08-16 10:23:49 +02:00
Louis Wicket (wil) f1722c7334 [IMP] *: unify sprintf and gettext
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.

closes odoo/odoo#123932

Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-10 18:14:04 +02:00
Louis Wicket (wil) 8d4650e673 [I18N] l10n_it_edi: restore missing translation
closes odoo/odoo#129754

X-original-commit: 1d316430b77e6efc7dc4501f2e8cfc78d6da9a39
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-27 05:18:46 +02:00
Louis Wicket (wil) 8b5f022a51 [IMP] mail: don't convert iterables to arrays in t-foreach
As of Owl 2.2, it is now possible to use iterable directly in t-foreach
without having to convert it to array first.

This commit takes advantage of this new feature to remove the
unnecessary array conversions from the Discuss code.

closes odoo/odoo#129765

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-27 00:55:07 +02:00
Louis Wicket (wil) 7da30c7d14 [FIX] mail, *: fix grammar error in field help
This commit fixes a really old grammar error in the help message of the
message_needaction_counter field.

Before this commit: “Number of messages which requires an action”
After: “Number of messages requiring action”

The subject of “require” is “messages”, which is third-person plural, so
it can't take the -s suffix.

closes odoo/odoo#129468

X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-25 17:36:08 +02:00
Louis Wicket (wil) 42bf1dc576 [FIX] web: make remaining days field fully translatable
Prior to this commit,
```xml
<t t-elif="days gt 1">In <t t-esc="days" /> days</t>
```
resulted in two separate translations: “In” and “days”.
This commit fixes the problem by explicitly putting the full text in a
gettext.

closes odoo/odoo#129388

X-original-commit: d278fc234540120e86733c2131515a5223d92c87
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-24 23:03:54 +02:00
Louis Wicket (wil) 911195fbbc [FIX] web: make “Developer Tools” translatable
The title of the “Developer Tools” section of the settings is not
translatable. This is because the extractor ignores nodes that are OWL
components. This commit solves the problem by moving the text to be
translated elsewhere.

closes odoo/odoo#129386

X-original-commit: e91370aed41847f9c89bb6ab590f929e6935ac12
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-24 21:27:42 +02:00
Louis Wicket (wil) 01efe0c7c9 [FIX] mail, *: fix typo in field description
Before this commit: Body content is the same as tmeplate
After: Body content is the same as the template

*: hr_recruitement, sale, survey, website_slides

closes odoo/odoo#128953

X-original-commit: 388e340a52fd5775c1702f8952a1e959fa5cef48
Related: odoo/enterprise#44309
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-19 10:24:07 +02:00
Louis Wicket (wil) 2391d31693 [FIX] im_livechat: use frontend language for welcome bot
Translate Welcome Bot's messages according to the language of the
frontend.

closes odoo/odoo#128745

X-original-commit: 68fca3cc6a62adf418c516f28a6b29e235475b5f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-17 18:13:51 +02:00
Louis Wicket (wil) ced4efa612 [FIX] mail: format date tracking values according to the locale
Prior to this commit, date tracking values in Chatter were always
formatted using the LL/dd/yyyy format.
After this commit, date tracking values will be formatted according to
the user's locale, so as not to cause discrepancies with other dates.

closes odoo/odoo#127834

X-original-commit: 865522e0925fbeae14f5f83d3a2d69a54b546b04
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-07 20:24:58 +02:00
Louis Wicket (wil) db96c237b1 [I18N] account: reexport sources & update Khmer translation
closes odoo/odoo#127596

X-original-commit: 7267f8eecd844f0dbf443579205d81c82efdd577
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-07 09:42:16 +02:00
Louis Wicket (wil) ce07b37111 [IMP] mail: make channel_info private
Make `channel_info` private so that it is no longer exposed to RPCs.

closes odoo/odoo#127078

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 00:51:54 +02:00
Louis Wicket (wil) d0710323b9 [REM] mail: remove dead code
closes odoo/odoo#126641

Related: odoo/upgrade#4866
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-29 14:08:47 +02:00
Louis Wicket (wil) 67fcae349c [I18N] l10n_cn: update translations
+ update PO and POT files
+ unify i18n and i18n_extra
+ rewrite traditional Chinese to simplified Chinese

closes odoo/odoo#126396

X-original-commit: 02c6c2bed691f263a383636c5209aba5c8c6cf57
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-26 22:15:22 +02:00
Louis Wicket (wil) e9f6c94aa6 [FIX] mail: show same unpin message everywhere
Before this commit, the unpin message was different depending on whether
the message was unpinned from the “pinned messages panel“ or from the
message action.

This commit unifies both flows by introducing a common method to pin and
unpin messages.

closes odoo/odoo#126072

X-original-commit: 9cf7ec443dce3a3d40a3e67533de60491bc9e7b6
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-22 19:37:15 +02:00
Louis Wicket (wil) f253e0ba14 [FIX] website: lazy load translations
`_lt` must be used instead of `_t` for `gettext`s that are called when
the file is loaded.

closes odoo/odoo#125695

X-original-commit: 1cde6dc66c3337fa8e6c18156340f18fdab1dd84
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-20 14:41:04 +02:00
Louis Wicket (wil) 8f65738646 [I18N] l10n_it_edit: update translations
closes odoo/odoo#122965

X-original-commit: 614a2d3136beb1bf8fab945fdbafb75090984ac5
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-05-31 13:08:11 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Louis Wicket (wil) 7792d45604 [FIX] iap_mail, web: fix untranslatable text
Some translations could not be exported, as reported in odoo/odoo#114711.

This is due to Babel—the library we use to extract `_t` occurrences from
the sources—ignoring javascript template literals, resulting in any
gettext inside template literals not being parsed and exported as
translatable resources.

From version 2.12.0 of the library, support for javascript template
literals can be enabled by providing the `parse_template_string` option
to the Babel `extract` method.

Unfortunately, the library cannot be updated for now, as our policy is
to stick to the version of packages from the official Debian repository.

This commit refactors some code so that no gettext is inlined within
template literals.

closes odoo/odoo#119996

Related: odoo/enterprise#40457
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-05-09 14:28:58 +02:00
Louis Wicket (wil) 03aada713a [IMP] mail: hold shift to select emoji without closing the picker
Clicking on an emoji from the emoji picker while holding down the Shift
key now prevents the emoji picker from closing, allowing users to easily
select multiple emoji in one go.

Task-3288704.

closes odoo/odoo#119598

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-25 14:07:38 +02:00
Louis Wicket (wil) 192fe9efc7 [I18N] l10n_it_edi: update Italian translation
closes odoo/odoo#119218

X-original-commit: 3ed088ae93bdfe5565205949779cae8b7c1d34e7
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-04-20 16:40:48 +02:00
Louis Wicket (wil) c16bef413f [FIX] mail: adjusts member list separator to the locale
Prior to this commit, the separator used to separate the names of the
members of a group DM could not be translated. This is because the
string being translated is too short to be considered by the translation
system.

This commit fixes the problem by no longer relying on the Odoo
translation system and instead using the ECMAScript Internationalization
API.

closes odoo/odoo#118306

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-13 04:08:45 +02:00
Louis Wicket (wil) 418159b716 [IMP] mail: sync activities data between tabs
Task-2714099.

closes odoo/odoo#115986

Related: odoo/enterprise#38537
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-31 17:02:30 +02:00
Louis Wicket (wil) 0c53d28133 [IMP] *: remove "French spacing"
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#116167

Related: odoo/enterprise#38542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-24 12:50:13 +01:00
Louis Wicket (wil) 10716e4837 [FIX] mail: allow accurate translation by providing full context
closes odoo/odoo#116195

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-22 14:52:44 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Louis Wicket (wil) 1cd529c43f [FIX] mail: fallback extension to mp3 when ogg fails to be played
closes odoo/odoo#106106

X-original-commit: 2a6e113eca016489e8ededcb8ba6a47d093c4b27
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-11-23 12:24:43 +01:00
Louis Wicket (wil) 1f89f7051a [IMP] mail: model core clean up
Remove redundant checks and inline functions that are used only once.

closes odoo/odoo#104992

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-11-07 13:50:05 +01:00
Louis Wicket (wil) a0927af12a [IMP] mail: remove leading whitespaces
Remove leading whitespaces introduced in 0cb45f3d19e37b9799c3b5064d4ff3d56127fb4d

closes odoo/odoo#105123

Related: odoo/enterprise#33692
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-11-07 11:27:21 +01:00
Louis Wicket (wil) d87308626c [IMP] mail: introduce 'ref' field attribute
Part-of: odoo/odoo#105099
2022-11-06 00:28:15 +01:00
Louis Wicket (wil) e465d878cd [IMP] mail: allow componentSetup to be patched
Part-of: odoo/odoo#105099
2022-11-06 00:28:15 +01:00
Louis Wicket (wil) 4513998b13 [FIX] mail: do not pin chat for correspondent if no message
Opening a DM chat with someone for the first time automatically pins
that chat for correspondents (i.e. the chat appears in Discuss), even if
no message has been sent yet. This can be unsettling for the person who
didn't create the chat but finds themselves with an unsolicited chat
pinned with no message.

This commit solves the problem by explicitly writing is_pinned to False
for the member that is not the current user.

Task-3028156.

closes odoo/odoo#104243

X-original-commit: 395bbc0ab2c2fc2eaee9d2bbe42b507fc84ee83a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-27 10:37:45 +02:00
Louis Wicket (wil) eb24659182 [FIX] mail: fix unstar button title
The toggle star action view currently does not take into account the
starred state of the message, returning "Mark as Todo" unconditionally
as a title for the button.

This commit adds a check for the starred state to return an appropriate
title if the message is already starred.

closes odoo/odoo#103432

X-original-commit: b77660850bb0dbf4fad2a52d931e230f4acde975
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-18 17:12:07 +02:00
Louis Wicket (wil) 051495ab95 [IMP] mail: move code from components to models (DiscussMobileMailboxSelection)
- Create DiscussMobileMailboxSelectionView model
- Pass DiscussMobileMailboxSelectionView record as props

Task-3014747.

closes odoo/odoo#103317

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-17 18:11:21 +02:00
Louis Wicket (wil) 2e2700e69e [IMP] mail, *: move code from components to models (ThreadTypingIcon)
*: im_livechat

Task-3004018.

Part-of: odoo/odoo#103317
2022-10-17 18:11:20 +02:00
Louis Wicket (wil) 2ae8ad027c [IMP] mail: move code from components to models (ThreadTextualTypingStatus)
Task-3002619.

Part-of: odoo/odoo#103317
2022-10-17 18:11:20 +02:00
Louis Wicket (wil) 2a57a6765f [IMP] mail: move code from components to models (MessagingMenuTab)
Task-3004195.

Part-of: odoo/odoo#103317
2022-10-17 18:11:20 +02:00
Louis Wicket (wil) f6a3153612 [IMP] mail, *: move code from components to models (DiscussSidebar)
* = im_livechat

Create DiscussSidebarView
Replace the use of useUpdate with useUpdateToModel
Task-3004215.

Part-of: odoo/odoo#103317
2022-10-17 18:11:19 +02:00
Louis Wicket (wil) fa4c0103bd [IMP] website_livechat: move code to models (VisitorBanner)
- Create VisitorBannerView model
- Pass record as props
- Turn other props on component into fields on model
- Remove export default

Task-3004301

closes odoo/odoo#102387

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-11 17:59:02 +02:00
Louis Wicket (wil) bfc1d414db [IMP] mail: forbid default values on identifying fields
There is no strong need to have default values on identifying fields,
while allowing it adds overhead to every insert. The trade-off is not
worth it, therefore this commit removes the support for identifying field
default values and simplifies the code of findFromIdentifyingData
accordingly.

closes odoo/odoo#102912

Related: odoo/enterprise#32634
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-10 18:08:43 +02:00
Louis Wicket (wil) 3e3b43e597 [IMP] mail: merge path and filename fields of SoundEffect
Context:
We want to get rid of default values on identifying fields, and
SoundEffect/path is currently the only field to present this pattern.

Merging path and filename fields together makes the default value no
longer meaningful, as there is no full path that is shared by multiple
records and which would therefore consist of a relevant default value.

The point of removing default values from identifying fields is to
simplify the code of findFromIdentifyingData, which is called by every
single insert, so that we no longer have the overhead of looking for
default values.

This commit modifies the SoundEffect model in order to enable the
simplification (and therefore, optimization) of findFromIdentifyingData.

Part-of: odoo/odoo#102912
2022-10-10 18:08:42 +02:00
Louis Wicket (wil) 30a9ecc14c [IMP] mail: split related paths only once
closes odoo/odoo#102501

X-original-commit: ab802a367c1e115e6f02a3657f42fae4e691ad28
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-06 23:14:13 +02:00
Louis Wicket (wil) abfc535a1f [IMP] mail: add error message for field patch with fieldType
closes odoo/odoo#102363

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-10-06 17:00:24 +02:00
Louis Wicket (wil) c90e18c3df [IMP] mail: move code from components to models (PersonaImStatusIcon)
+ Turn props on component into fields on PersonImStatusIconView model
+ Move handler from component methods to model record methods

Task-3004188.

closes odoo/odoo#101943

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-06 14:56:47 +02:00
Louis Wicket (wil) 8bd03d3984 [IMP] mail, *: move code from components to models (ThreadIcon)
Task-3002515.

* = hr_holidays, im_livechat

closes odoo/odoo#101774

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-06 14:56:44 +02:00
Louis Wicket (wil) 5768b03bdc [IMP] mail: move code from components to models (NotificationRequest)
Move methods on component to model record methods.

Task-3004192.

closes odoo/odoo#101952

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-06 00:36:48 +02:00
Louis Wicket (wil) 9cc35e276d [IMP] mail: move code from components to models (ComposerTextInput)
+ Create ComposerTextInputView model
+ Replace uses of useRef with useRefToModel
+ Replace use of useUpdate with useUpdateToModel
+ Remove dead code (ComposerTextInput._isEmpty)

Task-3001200.

closes odoo/odoo#101707

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-04 17:01:26 +02:00
Louis Wicket (wil) d562840f69 [IMP] mail, *: refactor patch API to look like model definitions
Model patches are now defined using the `registerPatch` function. This
function takes an object as argument which keys match those of a model
definition.

Benefits:
+ More consistent shape between model definitions and patch definitions
+ No need to import one function to each type of patch
+ No need to repeat the model name for each type of patch
+ No need to import the original definition

Task-2998282.

* = calendar, crm, hr, im_livechat, note, rating, sms, snailmail,
    website_livechat, website_slides

closes odoo/odoo#101827

X-original-commit: 7d23491b44b7372209057ea2abc565a95710b316
Related: odoo/enterprise#32136
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-03 16:18:49 +02:00
Louis Wicket (wil) 960a4faa4c [IMP] mail, note: unwrap sorting rules array
Remove sorting rules arrays from the functions that wrap them as they
are unnecessary noise.

closes odoo/odoo#101039

X-original-commit: b37baf8996d65d639f0178651a7be0206d0679d0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-24 00:33:11 +02:00
Louis Wicket (wil) 5d71683c7a [IMP] mail: harmonize field presentation in debug messages
After this commit, fields from models framework are stringified to
follow the presentation ModelName/fieldName.

Task-2992286

closes odoo/odoo#100845

X-original-commit: d645bf2c708f67ff27d004b79754926f3086c58b
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-09-23 12:28:42 +02:00
Louis Wicket (wil) 3d0fdc59a0 [IMP] mail, im_livechat: remove conditions from sort
This commit makes all sorts unconditional, which would allow us to get
rid of the functions that wrap the sorting rules and use arrays directly
instead.

This will allow us to lighten the syntax and to perform some
optimizations in subsequent PRs.

Task-2992581.

closes odoo/odoo#100895

X-original-commit: 4d15ca0f6883fb089e8d7514c4e639b86cedbd45
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-09-23 11:22:14 +02:00
Louis Wicket (wil) b9b0d9c462 [IMP] mail, *: inverse of identifying is automatically causal
* = im_livechat, snailmail

The model manager will now automatically add `isCausal: true` to inverse
of identifying fields. This commit implements the feature and removes
now unnecessary declarations of `isCausal: true` from the code.

Task-2741402.

closes odoo/odoo#100119

Related: odoo/enterprise#31290
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-14 21:22:15 +02:00
Louis Wicket (wil) 9e685f0147 [IMP] mail: move "isAddingItem" logic from Discuss to DiscussView
This move will remove the need of the adjustment compute and therefore
will avoid writing on computed fields.

closes odoo/odoo#99891

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-09 12:17:13 +02:00
Louis Wicket (wil) ff49527fb5 [IMP] mail, *: convert ThreadPreview to use Channel instead of Thread
* = im_livechat, rating, test_mail_full

Part of task-2948676.

closes odoo/odoo#99342

Related: odoo/enterprise#30921
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-05 16:53:52 +02:00
Louis Wicket (wil) 9beb2b13d3 [MOV] mail, *: rename ThreadPreviewView files to ChannelPreviewView
Part of task-2948676.
* = im_livechat, rating, test_mail_full

Part-of: odoo/odoo#99342
2022-09-05 16:53:52 +02:00
Louis Wicket (wil) 10950d549d [IMP] mail: add support for inline definition of sort and compute
This commit allows compute and sort functions to be declared within a
field definition instead of providing a string with the name of the
record method to be used to compute/sort the field value.

Example of code with compute inline:
```javascript
registerModel({
    fields: {
        thread: one('Thread', {
            compute() {
                return {
                    id: this.id,
                    model: 'mail'.thread',
                };
            },
        }),
    },
});
```

Example of code WITHOUT:
```javascript
registerModel({
    recordMethods: {
        _computeThread() {
            return {
                id: this.id,
                model: 'mail.channel',
            };
        },
    },
    fields: {
        thread: one('Thread, {
            compute: '_computeThread',
        }),
    },
});
```

The aim of these changes is to empower a better separation of concerns,
by allowing to group together in one place the data related to a field.

Note that for technical reason (`Function.prototype.call` not working as
expected with arrow functions), compute/sort functions should not be
arrow functions.

closes odoo/odoo#99424

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-02 19:14:04 +02:00
Louis Wicket (wil) fa445f6117 [FIX] mail: make Activity/note field readonly
3c28be1b33ea18be7280d9372ebd53a54140da86 enforced readonly by default on
computed and related fields, but Activity/note was not adapted to be
readonly, leading the application to crash when editing a note.

This commit fixes it by introducing a new field to write on instead of
the computed one.

Follow-up of task-2955927.

closes odoo/odoo#99310

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-31 18:54:04 +02:00
Louis Wicket (wil) c9d810f05f [IMP] mail: replace throw with warn in model manager
closes odoo/odoo#99306

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-31 18:54:00 +02:00
Louis Wicket (wil) 9fded39f48 [IMP] hr, mail: use Channel instead of Thread in getChat
Part of task-2948676.

closes odoo/odoo#99281

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-31 17:54:22 +02:00
Louis Wicket (wil) d713bf261e [FIX] mail: adapt RTC code to not write on readonly fields
3c28be1b33ea18be7280d9372ebd53a54140da86 enforced readonly by default on
computed and related fields, but some fields were not changed to be
readonly, leading the application to crash when editing them.

This commit fixes that by introducing new fields to write on instead of
the readonly ones.

Follow-up of task-2955927.

closes odoo/odoo#99253

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-31 17:54:13 +02:00
Louis Wicket (wil) 6a6e737f61 [IMP] mail, *: move channel concerns in Thread from Thread to Channel
This commit is the continuation of task-2948676 which consists of
lightening the Thread model by moving the channel-specific behaviours to
the Channel model.

The changes revolve around the DiscussSidebarCategoryItem model. The
goal is to use channel instead of thread as identifying field for
DiscussSidebarCategoryItem, and to move channel-specific fields involved
in the computes of this model from Thread to Channel.

Changes in this commit include:
+ move `avatarCacheKey` from Thread to Channel
+ move `correspondent`
+ move `correspondentOfDmChat`
+ move `custom_channel_name`
+ move `localMessageUnreadCounter`
+ move `serverMessageUnreadCounter`
+ introduce `Channel/displayName`
+ use channel instead of thread as identifying field for
DiscussSidebarCategoryItem

Part of task-2948676.

closes odoo/odoo#98149

Related: odoo/enterprise#30457
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-30 20:22:14 +02:00
Louis Wicket (wil) 427b984578 [IMP] mail: show more fields in mail.channel.member form view
closes odoo/odoo#92053

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-30 20:22:00 +02:00
Louis Wicket (wil) 381c0f0228 [IMP] mail: model_field: use this.model instead of record.constructor
Since be0fc43bbd0664340d555f2156630870e3548466, a reference to the model
is passed to ModelField constructor. This commit replaces all occurrences of
record.constructor with this.model (shorter and more straightforward).

closes odoo/odoo#98687

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 17:55:31 +02:00
Louis Wicket (wil) a8c73f285f [IMP] mail, rating: turn computes and relateds readonly by default
Automatically add readonly on computed and related fields. This commit
required to rewrite some preexisting fields to make them readonly.
Task-2955927.

closes odoo/odoo#98541

Related: odoo/enterprise#30625
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 17:55:22 +02:00
Louis Wicket (wil) af7dd7d79d [FIX] mail: get_mention_suggestions returns correct channel data
ac08da0a834631b2a7c39c40b1f36f01a85e8617 moved channel_type from Thread
to Channel, but data returned by get_mention_suggestions have not been
updated accordingly. This commit adapts it.

Follow-up of task-2948676.

closes odoo/odoo#98677

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 15:05:56 +02:00
Louis Wicket (wil) f728216a86 [IMP] mail, *: add validation for OnChange + get rid of OnChange class
In this commit:

+ Add validation for OnChange definitions 💪
+ Fix the errors found thanks to the new validation 🤩
+ Get rid of the `OnChange` class (useless boilerplate code) 😤

* = calendar

closes odoo/odoo#98549

Related: odoo/enterprise#30631
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-22 19:12:47 +02:00
Louis Wicket (wil) 4c3a483944 [IMP] mail: add validation for model definition section names
closes odoo/odoo#98556

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-22 16:49:04 +02:00
Louis Wicket (wil) 8537944b4b [IMP] mail: rewrite MessageReactionGroup/message to not use compute
closes odoo/odoo#98344

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-18 13:46:51 +02:00
Louis Wicket (wil) 5d43fad9e6 [IMP] mail, *: auto add implicit attributes of identifying fields
Automatically add `required` and `readonly` on identifying fields and
remove them from field definition.

Task-2955910.
* = calendar, hr, im_livechat, rating, snailmail, website_livechat

closes odoo/odoo#98283

Related: odoo/enterprise#30511
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-17 19:48:53 +02:00
Louis Wicket (wil) e8681d7440 [IMP] mail: remove useless memberThreads field on Partner
closes odoo/odoo#98191

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-16 17:50:07 +02:00
Louis Wicket (wil) 83b307bb0e [IMP] mail, im_livechat: remove useless guards
Remove useless guards introduced in odoo/odoo#97996.

closes odoo/odoo#98147

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-16 16:28:35 +02:00
Louis Wicket (wil) 090c558452 [IMP] mail, *: introduce Mailbox model for mail.box threads
This commit will simplify the code of Thread by properly splitting all
behaviors exclusive to mail.box threads.

* = test_mail_full

closes odoo/odoo#97996

Related: odoo/enterprise#30402
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-12 17:06:08 +02:00
Louis Wicket (wil) 52e6e0ce54 [IMP] mail, *: move channel_type field from Thread to Channel
As the name suggests, `channel_type` only makes sense for Channel.
This commit moves `channel_type` from Thread to Channel.

* = im_livechat, test_discuss_full

Part of task-2948676.

closes odoo/odoo#97779

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-11 17:56:51 +02:00