Before this commit, it was not possible to send messages in
full composer containing user mentions. Even whe the mentions were
added in the small composer and then continuing composing the message
in the full composer.
With this commit, we can now make user and channel mentions in the
full composer, by typing `@` and `#` like in the small composer of
Discuss.
When composing a message in small composer and then switching to full
composer, the mentions are preserved.
task-3470060
closesodoo/odoo#132701
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This PR introduce multiple usage of the escape key:
- Channel selector can now be closed using the escape key
- Using the escape key will focus the composer automatically
Task-3456518
closesodoo/odoo#135031
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, owl was in the linter's accepted global variables.
This allowed direct access to owl global object.
For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`
Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:
`import { xml } from "@odoo/owl";`
task-id 3498859
closesodoo/odoo#137517
Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Discuss model data that had commands have been simplified by [1].
Notably some `unlink` were replaced by `False` and or `DELETE`.
Some code in Discuss calls was still expecting receiving command data
in of `DELETE` while data received has become `false`. As a result,
the state of ringing threads and showing call invitation card was not
working.
This commit fixes the issue by relying on recent improvements that
commands can be passed immediately as data to relational fields [2].
Code in Discuss call still have some coupling between fields whenever
some records are either added to or removed from a field. Hooks
`onAdd` and `onDelete` on relational fields are added to support
these cases.
[1]: https://github.com/odoo/odoo/pull/136308
[2]: https://github.com/odoo/odoo/pull/137341closesodoo/odoo#137540
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
1. simplify message reaction formatter (personas)
Data was formatted to have "partners" and "guests" entries, both
of which contribute to personas.
To avoid some post-processing of data in JS, it's best to format
data to immediately include type of persona.
2. include "guestAuthor" in "author" data of message
Discuss models in JS group partners and guests into a single model
Persona, to make feature works regardless on whether user is
authenticated or not.
This commit simplifies code by removing data guestAuthor in message
formatted data, and instead author contains author data in all cases,
whether the author is a partner or guest.
3. simplify insert (remove id, redundant with preinsert)
Also rename Follower.isActive to Follower.is_active, for
even simpler Follower.insert()
closesodoo/odoo#137276
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit removes the legacy service mappers which are useless now.
closesodoo/odoo#136807
Task: 3439226
Related: odoo/enterprise#48015
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Before this PR, channel update were not sent via bus notifications.
Part of task-2821415
closesodoo/odoo#136623
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*board,mail,project
This commit aims to simplify the XMLParser logic and the way archs
are manipulated in views, motivated by [1] where we had to
modify the arch in View to insert access right information.
First, the xml utils have been reworked. The XMLParser class has
been removed. The xml utils module already exported a parseXML and
a serializeXML functions, this commit adds visitXML, s.t. the whole
XMLParser feature is fully replaced by the 3 functions.
Second, concrete views now receive the arch in props as an
XMLDocument, as the arch is parsed once for all in View. With this,
we were able to remove serializing/parsing back and forth at several
places, where we needed to extract information for sub-parts of an
arch individually (e.g. View, x2many subviews, list view groupby).
Third, even though this change has been driven by the one above and
wasn't initally wanted, the view compiler cache and API have been
simplified. The cache is now flat, there's an entry in the cache for
each template that has been compiled. Moreover, the useViewCompiler
hook no longer takes the cache key in params, as it can directly
compute it itself (the key being the outerHTML of the template).
[1] odoo/odoo#135145closesodoo/odoo#136376
Related: odoo/enterprise#47808
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Follow-up PR of https://github.com/odoo/odoo/pull/136308
Commit above simplified code in discuss models so code applies
on records than properties on records. For example, instead of
juggling between persona local id and persona, some code can simply
keep logic on persona without leaking local id.
However the improvements are iterative, and more improvements are
needed to stop using local id. Some code still need local ids.
Commit above mistakenly converts a local id to persona on some code
that still work in terms of local id. As a result, message reactions
were not working properly, notably when adding a new reaction using
click on an existing message reaction of someone else.
There was also a bug in implementation in mock server which made the
test not working. This commit fixes this issue too.
Task-3523101
closesodoo/odoo#136940
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
There is a double list encoding, probably not required. Coming from mail
enterprise code move.
closesodoo/odoo#137451
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This significantly eases processing command data on relational field
received from server.
closesodoo/odoo#137341
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This field contained 2 sets with partner and channel ids.
It's easier and safer to reason in terms of records rather
than properties on records.
Part-of: odoo/odoo#137341
The cookie service was replaced by a utils file in core. This was done
to be able to use the cookies without the need of environment.
"Om Nom Nom Nom" - Cookie Monster
part-of task-id 3439226
closesodoo/odoo#136782
Related: odoo/enterprise#48005
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This PR makes several actions available for the embed livechat
such as:
- calls
- message edition
- message reactions
- link previews
task-3523930
closesodoo/odoo#136618
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
With this commit, instead of `Record.insert()` before setting
relation with records, we can immediately pass record data.
For example:
```js
message.author = { id: 3, type: "partner", name: "Admin" };
thread.messages.add({ id: 10, body: "some-text-content" })
```
This is supported on all relational fields that define a target
model.
To make this work while drastically avoiding cyclic dependencies
in code, whenever data have to be inserted in relation, they are
pre-inserted with essential data, and then they are fully inserted
after being registered in the relation.
closesodoo/odoo#136539
Related: odoo/enterprise#47854
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This simplifies managing relations on the store, and gives
incentive to define them there instead of another prop that
is a record, e.g. `discuss`.
Part-of: odoo/odoo#136539
Add a computed m2m field giving allowed models for the action. It allows to
avoid choosing the wrong models when designing server actions.
Remove a test that has no use: it checks a model_id field is available on
server action view while we don't want to display it as it is imposed by
the rule itself.
Task-3527758 (Base Automation Refactor Fiximp)
Part of Task-3527752 (Mail: The Pre-Major Freeze FixImpLint)
Part-of: odoo/odoo#137133
Effectively check that mail-specific server action types are triggered only
on mail-enabled models that are not transient.
Check that mail and sms templates models match their action model by adding
constraints.
Task-3527758 (Base Automation Refactor Fiximp)
Part of Task-3527752 (Mail: The Pre-Major Freeze FixImpLint)
Part-of: odoo/odoo#137133
Summary should be taken from activity types when possible.
Task-3527758 (Base Automation Refactor Fiximp)
Part of Task-3527752 (Mail: The Pre-Major Freeze FixImpLint)
Part-of: odoo/odoo#137133
Fix name compute method:
* correctly call super in batch;
* correctly filter records;
* remove dependency on context key (which was missing in triggers);
In this commit we also consider the name update should always be done even
outside of automated rules context. Having a whole compute method relying
on a context key does not makes sense. As server actions are technical
records, having the name always being correctly updated is better.
Task-3527758 (Base Automation Refactor Fiximp)
Part of Task-3527752 (Mail: The Pre-Major Freeze FixImpLint)
Part-of: odoo/odoo#137133
Following the recent server action refactoring, it seems translations have been
forgotten in the review process.
Task-3527758 (Base Automation Refactor Fiximp)
Part of Task-3527752 (Mail: The Pre-Major Freeze FixImpLint)
Part-of: odoo/odoo#137133
With this commit, we now raise a UserError if a user tries to save a template
with a composer that has no attached model.
Task-2504439
Part-of: odoo/odoo#126049
Before this commit, all mail templates were shared, which was cluttering the UI
for everyone.
Now, each user can have their own templates that they can edit and save. Access
is done through the mail composer wizard, where users can only access their own
templates and templates that don't belong to anyone.
Some groups are considered as admins and can access all templates in
Settings/Technical/Email/Email Templates:
- Sales Admin
- Project Admins
- Helpdesk Admins
- Accountants
- Event Admins
- Recruitment Admins
Task-2504439
Part-of: odoo/odoo#126049
Copy calls 'create' on 'self' which means self is not a void recordset. In
mail this causes issues as it may have an impact of values generated for
aliases, which depends on 'self' when calling '_alias_get_creation_values'.
Followup of odoo/odoo#130632
Prepares Task-36879 (Mail: Support MultiCompany Aliases)
closesodoo/odoo#136968
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
It was calling super of another method. But as the base code (located in
base/ir_mail_server) is the same, the result is actually the same.
Followup of odoo/odoo#130750
Prepares Task-36879 (Mail: Support MultiCompany Aliases)
Part-of: odoo/odoo#136968
This fixes flickers in situations where:
- close (manually): notify
- open (manually): notify
- close (from bus)
- open (from bus)
The final state is correct, but it does one extra close and open.
With this fix, it becomes
- close (manually): notify
- open (manually): notify
- (close from bus ignored)
- (open from bus ignored)
Note: the fix is aimed towards fixing issues within the tab making the
manual change, which is the most common use case. Other tabs are not
considered visible at the time of the change, making the flicker
irrelevant, which is convenient to ignore as fixing it would require
more advanced mechanism.
runbot-24379
runbot-24994
closesodoo/odoo#136698
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The server is supposedly already aware of changes that are coming from
itself, it doesn't need to be notified again.
This prevents each extra open tab from making useless RPC.
This also fixes race conditions in situations where:
- close (manually): notify
- open (manually): notify
- close (from bus): notify close again <--- this is the bug
- open (from bus): already no notify for open from bus (ok)
- close (from bus again): and notify close yet again
Final state is close, whereas the user manually set open last.
With the fix, it becomes:
- close (manually): notify
- open (manually): notify
- close (from bus)
- open (from bus)
Finally state is open as expected, no extra RPC.
Note that is this example, there is still a problem, where an obsolete
value from the server (the first close from the bus) will overwrite the
newer local state (open), causing a potential flicker. This will be
fixed in a future commit.
runbot-24379
runbot-24994
Part-of: odoo/odoo#136698
In log note case, followers are not going to be notified of the message.
Therefore the recipients input should not be visible.
task-3504225
closesodoo/odoo#136661
X-original-commit: c60449a2efde457e8370928681f011c103ea1d60
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Go to the form view of mailing.mailing, write "hello " as the subject,
insert an emoji, you end up with "hello:)" instead of "hello :)". The
problem is that when the input loose the focus, it is automatically
trim.
Reconfigure the `char_emojis` widget so that is doesn't trim.
task-id-3493168
closesodoo/odoo#136530
X-original-commit: 2adda1eb2760ccf970761f424105e245afc3de3f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
In preparation to improve insert in relational field with data, so
that there's less risk for cyclic code execution (hint: there'll be
a preinsert).
closesodoo/odoo#136308
Related: odoo/enterprise#47777
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This method pushes the provided record if it's not in the record
list, otherwise it does nothing. This works a bit like `add()` on
Sets.
Part-of: odoo/odoo#136308
Relational data in server formatter are:
- for one relation: None/false or object
- for many relations: list of objects or list of commands
The commands were:
- 'insert': to add a new item in a relational field
- 'unlink': to remove an item from a relational field
- 'insert-and-unlink': to remove an item from a relational field
- 'clear': to remove all items from relational field
There was a slight nuance between 'unlink' and 'insert-and-unlink'
at some point, but it becomes irrelevant with current code of model.
The name of the commands were hard to grasp what they actually mean
for the many relations.
This commit improves it by renaming 'insert' by 'ADD' and the 2
'unlink' commands by 'DELETE'. This makes it more apparent that
the data in 'ADD' refers to data of record to add in the relation,
while 'DELETE' refers to data of record to delete from the relation.
The 'clear' has been replaced by `False` value instead of a command.
Part-of: odoo/odoo#136308
This allows to define categories as also models, which allow
to register list of threads as relational fields, which in turn
simplify code readability and maintainability of these relational
data.
Part-of: odoo/odoo#136308
These `update()` functions are specific to a discuss record,
so it's best to be defined in the model rather than another
service.
Part-of: odoo/odoo#136308
Steps to reproduce:
- Install `website_crm` module (for test purpose)
- Go to `Contact Us` page on website
- Edit the page
- Change the submit button to create an opportunity instead, then save
- Fill the form and save
- Go back to CRM app and open the opportunity just created
- In the chatter, try to send a message
- Click on the checkbox of the suggested recipient (to enable it)
Issue:
- Email is displayed twice in the suggested recipients before click
(instead of name + email or just email if same as name)
- Email is set as default name in the opened dialog
Cause:
- Displaying email even if same as name
- Not setting the fields with default values (received from
`/mail/thread/data` rpc call)
Solution:
- Don't display email if same as name
- For the suggested recipient label (next checkbox) : set name with
default name value if name parsed from mail is same value as email
- For the default values in the opened dialog: set default values with
defaults received from `/mail/thread/data` rpc call
opw-3470295
closesodoo/odoo#135951
X-original-commit: 02ef0425a1f4ae30d846f6c57489cdebc3b4bbad
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
This commit ensures that changes in translated fields on a freshly
duplicated record will apply to all translation even when the user
language is not en_US.
Steps to reproduce:
-go to accounting -> configuration -> taxes in other language than en_US
-open any record in form view
-duplicate the record
-change the name of the record and save
-ensure that the name is the same in all languages
task-3339736
closesodoo/odoo#134481
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Prior to this commit, there was a spacing issue in large screens (eg. 4K
screen), the form view wasn't large enough and this created a big gap
between the form view and the chatter.
This commit adapts the form view to large screens.
task-3453381
Part of task-3326263
closesodoo/odoo#136454
X-original-commit: 1a995cad898283f6909506ba43d1692381b3d6ef
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
This commit changes the canOpen prop of the many2oneAvatar field to be
set to true only when in form view. The field will therefore stop being
a link in readonly when outside of form view.
closesodoo/odoo#136118
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
* = bus, calendar, im_livechat, hr, project_todo, sms, snailmail,
test_mail, web, website_livechat
The current implementation often led to tests relying on DOM structure
to properly target the correct element with the text.
It is now easier to simply check if a parent contains some text.
closesodoo/odoo#136295
Related: odoo/enterprise#47770
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Some tests are updated to lessen diff in future tests, especially about
aliases. Some tests are fixed as they are somehow incorrect (notably
in gateway testing) but currently passing as mail gateway is quite
permissive.
Add some tests preparing MC / alias domains configuration notably about
company / alias synchronization, which is currently only based on config
parameters.
Also update some tests by using fstrings which are generally more readable.
Finally move some tests to their right file / main testing class to keep
them ordered by main topic.
Prepares Task-36879 (Mail: Support MultiCompany Aliases)
closesodoo/odoo#136318
X-original-commit: odoo/odoo@c18300e225
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>