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.
closesodoo/odoo#152606
X-original-commit: b839faf09be259ffdccf9d872e646e4ebe4a8bcb
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Nested gettexts aren't exported. This commit solves the problem by
moving the inner gettext outside of the arguments of the first gettext.
closesodoo/odoo#149921
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Fix done directly on Github to not have to wait for the weekly sync.
Already corrected on Transifex.
closesodoo/odoo#149544
X-original-commit: 1a0bee8af2b28987a631c84311227ebd55ec632a
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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
closesodoo/odoo#145971
Related: odoo/enterprise#52617
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
'field' is the name of a variable and shouldn't be translated
closesodoo/odoo#143441
X-original-commit: 52ce28f8c2e7998e247d3291e57ddd1ca3d604b9
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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
closesodoo/odoo#141723
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
The word “immatriculation” doesn't exist in English.
This commit replaces its occurrences with “registration”.
closesodoo/odoo#137755
X-original-commit: 740979ef152f5cc89682004f9453a03e565bf6ec
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
The module has been deleted, but the i18n directory is still there.
This commit removes it.
closesodoo/odoo#137079
X-original-commit: 603b9c6bf861c330eb28a15c095bba67483c1398
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Some strings are missing in the pot file and are therefore not
translated. This commit updates the pot file to the latest changes.
closesodoo/odoo#134039
X-original-commit: 22045d368a7beb72dc5330054dfa201c3c047e6f
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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.
closesodoo/odoo#132235
Related: odoo/enterprise#45908
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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
closesodoo/odoo#92032
Enterprise: https://github.com/odoo/enterprise/pull/27649
Related: odoo/enterprise#27649
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.
closesodoo/odoo#123932
Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
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.
closesodoo/odoo#129765
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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.
closesodoo/odoo#129468
X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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.
closesodoo/odoo#129388
X-original-commit: d278fc234540120e86733c2131515a5223d92c87
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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.
closesodoo/odoo#129386
X-original-commit: e91370aed41847f9c89bb6ab590f929e6935ac12
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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
closesodoo/odoo#128953
X-original-commit: 388e340a52fd5775c1702f8952a1e959fa5cef48
Related: odoo/enterprise#44309
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Translate Welcome Bot's messages according to the language of the
frontend.
closesodoo/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>
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.
closesodoo/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>
+ update PO and POT files
+ unify i18n and i18n_extra
+ rewrite traditional Chinese to simplified Chinese
closesodoo/odoo#126396
X-original-commit: 02c6c2bed691f263a383636c5209aba5c8c6cf57
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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.
closesodoo/odoo#126072
X-original-commit: 9cf7ec443dce3a3d40a3e67533de60491bc9e7b6
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
`_lt` must be used instead of `_t` for `gettext`s that are called when
the file is loaded.
closesodoo/odoo#125695
X-original-commit: 1cde6dc66c3337fa8e6c18156340f18fdab1dd84
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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.
closesodoo/odoo#119996
Related: odoo/enterprise#40457
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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.
closesodoo/odoo#119598
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#118306
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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.
closesodoo/odoo#116167
Related: odoo/enterprise#38542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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.
closesodoo/odoo#114533
Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#104243
X-original-commit: 395bbc0ab2c2fc2eaee9d2bbe42b507fc84ee83a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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.
closesodoo/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>
- Create VisitorBannerView model
- Pass record as props
- Turn other props on component into fields on model
- Remove export default
Task-3004301
closesodoo/odoo#102387
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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.
closesodoo/odoo#102912
Related: odoo/enterprise#32634
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
+ Turn props on component into fields on PersonImStatusIconView model
+ Move handler from component methods to model record methods
Task-3004188.
closesodoo/odoo#101943
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
+ Create ComposerTextInputView model
+ Replace uses of useRef with useRefToModel
+ Replace use of useUpdate with useUpdateToModel
+ Remove dead code (ComposerTextInput._isEmpty)
Task-3001200.
closesodoo/odoo#101707
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/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>
Remove sorting rules arrays from the functions that wrap them as they
are unnecessary noise.
closesodoo/odoo#101039
X-original-commit: b37baf8996d65d639f0178651a7be0206d0679d0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
After this commit, fields from models framework are stringified to
follow the presentation ModelName/fieldName.
Task-2992286
closesodoo/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>
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.
closesodoo/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>
* = 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.
closesodoo/odoo#100119
Related: odoo/enterprise#31290
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This move will remove the need of the adjustment compute and therefore
will avoid writing on computed fields.
closesodoo/odoo#99891
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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.
closesodoo/odoo#99424
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#99310
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#99253
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#98149
Related: odoo/enterprise#30457
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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).
closesodoo/odoo#98687
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Automatically add readonly on computed and related fields. This commit
required to rewrite some preexisting fields to make them readonly.
Task-2955927.
closesodoo/odoo#98541
Related: odoo/enterprise#30625
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#98677
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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
closesodoo/odoo#98549
Related: odoo/enterprise#30631
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Automatically add `required` and `readonly` on identifying fields and
remove them from field definition.
Task-2955910.
* = calendar, hr, im_livechat, rating, snailmail, website_livechat
closesodoo/odoo#98283
Related: odoo/enterprise#30511
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit will simplify the code of Thread by properly splitting all
behaviors exclusive to mail.box threads.
* = test_mail_full
closesodoo/odoo#97996
Related: odoo/enterprise#30402
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.
closesodoo/odoo#97779
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The way the code has evolved, `create` is now no more than an
unnecessary indirection for `insert`.
This PR removes `create` and replaces its uses with `insert` directly.
closesodoo/odoo#97058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>