Attachments that are uploaded on a record that isn't saved yet are
created with res_id set to 0. In the case of attachments linked through
a m2m rather than the usual (res_model, res_id), it means they may not
be readable afer the creation of the record, except by their creator.
Re-attaching them to the mailing / template at the end of the create()
call fixes the ownership.
Fixes#81935closesodoo/odoo#82120
X-original-commit: 05fb705f2729ffdf07ab36accda20415a44e1aa6
Signed-off-by: Olivier Dony <odo@odoo.com>
Before this PR, the mail_channel/add_member function use multiple _sendone. We
can compile the notifications inside a single sendmany.
Task-2726415
closesodoo/odoo#82198
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit renames the isMuted variable into isSelfMuted to reflect the
user action of self muting, as opposed to the state of being mute,
which will be distinct in an upcoming commit.
part of task-2720026
closesodoo/odoo#82199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this PR, the guest that just connect wouldn't receive the longpolling
message before the current one expire.
task-2664831
closesodoo/odoo#82170
X-original-commit: 0006123dba46d32d062a581e9a16f433f3ce05f3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Step to reproduce:
- Settings -> Mail channel -> any chat-type channel
- Go to Members
- Add an user
- Refresh the page
Current Behaviour:
- Traceback
- Chat are designed for 2 users and you should not be able to add more
Behaviour after PR:
- Can only edit members of channel if it's not a chat
- User error if try to add more user
- Fix traceback if there is too much users
opw-2717341
closesodoo/odoo#82044
X-original-commit: 85f7b7c1304222966610833dc325bc47f1c13158
Related: odoo/enterprise#23156
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Invalid data provided at record creation were silently skipped by the
framework without triggering an error. This commit ensures that data are
no longer accidentally filtered and therefore that an error will be
raised if a key that does not match an actual field is provided.
This commit also removes the dead code that was detected thanks to these
changes.
closesodoo/odoo#81909
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Bug
===
Since 2d359b909b we moved the mailing
list feature of the <mail.channel> in a different model, <mail.group>.
During this split, some SMTP headers have been forgotten.
Task-2721009
closesodoo/odoo#81887
X-original-commit: daf9c0300fb042891c019e4f2a8c5395de388e1c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this PR, user could edit notifications message.
task-2713602
closesodoo/odoo#81803
X-original-commit: 45e9f367d583ec8fafdf19c9e5451bdff0e16e62
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The `_insert_followers` wasn't batch in the `create` of `mail.thread`
for no reason, which call the create of a `mail.follower` one by one.
It is inefficient for the batch records creation (import or some
flows) of a model with `_inherit = [mail.thread, ...]`.
Then batch it, to miminize the cost of `_insert_followers`:
The creation of 100 `mail.follower` takes:
- 0.107 sec if you create one by one (before)
- 0.022 sec if you create in batch (now)
Also add two tests (on model with a chatter):
- One testing the behavior of follower and subtype in case of
multi-create
- One testing the number of queries done to create 5 records.
The old SQL request count was 23, now it is 19 (-1 by create
call).
task-2711448
closesodoo/odoo#80954
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, it would fetch all channels partners of all channels, even
for big channels and for members that were not useful to known anything about.
This commit reduces the number of fetched members to a more reasonable level,
and ensure the formatting of those members is done only once, instead of once
per channel.
Time goes from 90ms to 1ms for 1000s of members in 100s of channels.
Part of task-2702450
closesodoo/odoo#81262
X-original-commit: 89419b593ed163a8b174945e80f1c36c9cf78257
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Forcing a fetch of all channel partners for all channels is not efficient
because there are too many of them.
Replace by a count done in SQL through `read_group`.
Time goes from 100ms to 3ms for 1000s of members in 100s of channels.
Part of task-2702450
closesodoo/odoo#81175
X-original-commit: 7c77775a84474ccdfe32bdd783291728fbfbdc42
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
For email design in the context of Microsoft Outlook, we want to keep
some magic Microsoft comments (Outlook conditional comment), which -
until this commit - were skipped by QWeb. These allow us to change the
rendering exclusively for Outlook so as to overcome some of its
limitations. This commit introduces a qweb rendering option
(`preserve_comments`) for when - like in mass mailing and digest - we
want to keep comments.
Part-of: odoo/odoo#80621
`_replace_local_links` ensures urls are given as absolute rather
relative paths, for link `href`, img `src` and within styles. This
failed when the style contained escaped single quotes (eg:
`background-image: url("/my_url/path");`). This commit adapts the
failing regex appropriately.
X-original-commit: 2af980e8cdc72d35729ef2fbaf5067fe7e72bbb8
Part-of: odoo/odoo#80621
Since https://github.com/odoo/odoo/pull/73689 all internal users are no longer
known at init. Unlike what was stated in the corresponding PR, the code of
mentions wasn't actually good enough to allow it without any drawback.
This PR fixes the issue by prioritizing internal users on the result of the RPC.
As a bonus the internal user state is immediately returned when fetching
followers, which allows mentions to be accurate even before the RPC is done.
task-2695224
closesodoo/odoo#80645
X-original-commit: 86de2f231be87b289deb85c3b20b93d890cce918
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
* Avoid computing logic in get_values, use a clean compute instead
* Leave the management of config parameters to the generic behavior in
base, no need to override set_values to do it "manually".
Furthermore, in the mail case, the set_values override enforced the creation
of a falsy parameter, which goes against the generic parameter logic to avoid
having falsy values for nothing in database.
Part-of: odoo/odoo#62249
PURPOSE
Before this commit, when a partner was created through the
suggested recipient tool the langage wasn't considered...
The email was thus sent in the wrong langage most of the time
After this commit, the suggested recipient tool had the
langage correctly if present in the record.
LINKS
Task-2580065
PR : odoo/odoo#76812
Current behavior :
When we try to add a member through channel's settings by clicking on "Add a line", a blank line is correctly added but can't be edited.
Steps to reproduce :
- Install Discuss
- Go to channel settings
- Try to add a member by clicking on "Add a line"
Reason :
Since commit 89eef4cdd419cc23cfb8d3e0af7a7115119549c2 , 'partner_id' field as been set to readonly because it doesn't make sense to edit the partner_id of a channel. However, this prevents the possibility of adding a member.
( diff : https://github.com/odoo/odoo/pull/75496/files#diff-d02eca5ffaa6b9765330a905661cd6cb917b92d851b473d459ee011bb2c5be3cR17 ).
OPW-2677329
closesodoo/odoo#80326
X-original-commit: 9536f8ec556670f67939fdee825630e06d5b4808
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
PURPOSE
Concatenate feedback message and tracking when marking a lead as lost. This
currently generates 2 consecutive message about the same change, having a
single one is better from an UI point of view.
SPECIFICATIONS
Allow to link a body to a value change tracking. Tracking is currently done
by accumulating changes in a structure (see ``env.cr.precommit.data`` usage
with ``mail.tracking.<name>`` key). In the end those values are used to
generate a message with tracking value and a subtype.
In this commit we allow to manually set a body used as a message for the
tracking message, adding a new ``mail.tracking.message.<name>`` key. It is
used when posting or logging the tracking message, simply propagated as body
to ``message_post`` or ``message_log``.
In crm we use this when losting a lead through the dedicated wizard. A bit
of custom html allows to have a nice display.
Task-2671709
Part-of: odoo/odoo#78648
Purpose is to have tracking methods beginning with ``_track``, indicating
those are tool methods used for tracking. It helps organizing the mail thread
file and having short but precise method names.
We also remove the usage of ``mail_track_log_only`` context key that is not
used anymore in the code. It allows to shorten a bit the code and make it
easier to read.
Task-2671709
Part-of: odoo/odoo#78648
Accessing `valid_docs.ids` for each activity to check was costly, and in
my example the whole loop took 125 seconds to execute.
By turning it into a set, the same loop takes 0.2 seconds to execute.
When re-constructing the list based on ids to keep the order, using a
set is also faster, and takes another 0.2 seconds instead of 13.6.
closesodoo/odoo#79969
X-original-commit: f994db760b679c8acdaf4245315f89c1d31a9e1c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Because activities_to_check was assigned in each loop, the result was
only containing the last chunk of 1000 records, instead of the whole
result.
This commit fixes the issue by concatenating into the list instead of
just assigning it.
X-original-commit: c06c96655b88cc4df59b8cdd5f05a2f600255c49
Part-of: odoo/odoo#79969
Before this commit, the server was returning the wrong format
for the partner data.
This commit fixes this issue.
closesodoo/odoo#79871
X-original-commit: bf2db96093e955eebb23777c153c6583352cc0e9
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to reproduce the bug:
- Create a PO
- Remove the Purchase representative
- Send a reminder to confirm the order date
- Open the reminder email and click on No, Upate date
- Choose a date
Bug:
An access error was raised because a user_id is required to create a mail.activity
PS: When passing user_id=False to function activity_schedule, user_id=False was kept when
creating the mail.activity
opw:2638140
closesodoo/odoo#79841
X-original-commit: 14ed4b66c7eafeb7a883484d42437b450801fbb1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, it wasn't possible to save the volume
of guests, the backend was already implemented but the
feature hasn't been implemented in the frontend, this commit
fixes this issue by completing the implementation.
taskId-2679227
closesodoo/odoo#79714
X-original-commit: 149456839f8379422affb53b7b64c6190b6e9f42
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Issue: When test sending a mail in Marketing Automation Mailings, there
is a traceback because we try to set the state of the mail to done,
even though there is no done in mail_mail.state
Steps to reproduce :
1) Install Marketing Automation
2) Create/select a campaign
3) Access the templates of that campaign
4) Create/select a template
5) Click Test
6) Send Sample Email
-> Traceback
opw-2568210
closesodoo/odoo#79650
X-original-commit: 954c413149befe847a526b54a1fca4c0dd2b16cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Make CI/Style happy even if not really related to this PR.
Task-2621326 (Mail: add 'view' button in 'light notification template')
Part-of: odoo/odoo#76418
RATIONALE
Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.
SPECIFICATIONS
On template model: rename ``notif_layout`` parameter of ``send_mail`` to
``email_layout_xmlid`` to be coherent with naming used in other parts of the
code. Moreover it better indicates we expect an xml id.
On rating model: rename ``notif_layout`` parameter of ``rating_send_request``
to ``email_layout_xmlid``, for the same reasons as above.
In various wizards: support ``email_layout_xmlid`` context key when no field
is available, notably because this is still done manually in some wizards
like survey invite. Keep a fallback on ``notif_layout`` but remove support of
``custom_layout`` deprecated since quite a long time.
Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)
Part-of: odoo/odoo#76418
RATIONALE
Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.
SPECIFICATIONS
Get rid of context usage (``custom_layout``) and use a real field on composer
model: ``email_layout_xmlid``. Use now a default value coming from context
(default_email_layout_xmlid) instead of custom_layout.
Support old context key in composer for backward compatibility, working like
a default value for the field itself.
Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)
UPG odoo/upgrade#2829
Part-of: odoo/odoo#76418
Purpose
=======
Hide non-relevant fields for a portal user. E.G. we want to hide the
notification type, the menu customization... Because those fields
make no sense for a portal user.
Force the non-internal user to receive notifications by emails since
they can not open Discuss.
Task-2508521
Part-of: odoo/odoo#77766
Co-authored-by: nounoubensebia <neb@odoo.com>
If there was parameters in the from clause, there was a possible error
when reading progress bar for activities.
eg. grouping product.product by "Routes" raise an error because we have
in FORM clause like:
FROM … ON … AND "product_template__route_ids"."route_id" IN
(SELECT … WHERE … OR ("stock_location_route"."company_id" in %s))
so when we add timezone to parameters, it should be after FROM clause
parameters and before WHERE clause parameters.
opw-2674179
closesodoo/odoo#78867
X-original-commit: 904d0aab204b0ce40d7bc284086c33cbde6f06d8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
* = auth_signup, calendar, im_livechat, snailmail_account, survey, test_mail,
web_editor, website_crm_iap_reveal, website_livechat
The aim of this PR is to improve/fix various flaws and limitation of the current
API, to make it easier to use and more efficient.
Notification are now defined with 3 distinct parts:
- the channel determines which client(s) should receive it
- the type determines how it should be handled
- the payload determines any extra information helpful for handling it
Channel
=======
Business code
-------------
- Record channel is introduced for ease of subscribing to and sending
notifications to specific partners, channels, documents, ...
- String channel is still supported (but it is converted internally to the tuple
channel).
- Tuple channel is still supported without any change (but should be avoided
whenever possible due to its complex syntax).
The channel is no longer sent to the client. When the channel was used for
business purpose, the information it contained has been moved into either the
new type, or the payload itself.
Technical note
--------------
All channels are now internally converted to the tuple (db, ...) channel, which
is necessary for the platform code (saas/sh).
Internally, the bus.bus table is not changed, type and payload are grouped
together into what was (and still is) called message.
Type
====
Type is introduced to uniformize the way notifications are sent and handled.
All existing notifications already had some kind of manually-built type in them.
This is now officially supported at the bus API.
In client code this will allow (to be done in future commits) to register one
handler per specific type, instead of having to iterate and to filter all
received notifications on every handler.
Payload
=======
Payload (ex message) did not change, it can still be anything depending on
business needs.
Few adaptations:
- When the type was included on the payload, the type has been moved to the new
type parameter.
- When the channel was used in business code, its data has been copied into the
payload.
task-1891151
closesodoo/odoo#79201
X-original-commit: 543af27c7d6836ffac9e80ff8490b6ddbd849221
Related: odoo/enterprise#21998
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Since [1] and [2], the mobile app gets this error when trying to login
on v15, while it was working fine in v14 with TOTP enabled.
The 'authenticate' JSON-RPC route tries to authenticate the user and
then call `session_info()`. As no UID is defined, some methods in
`session_info()` raise an exception and an unexpected error is sent:
* `_is_public()` -> "Expected singleton: res.users()"
* `get_web_translations_hash()` -> "lang"
In this fix, this exception is avoided and the proper result is sent,
allowing the authentication process to continue.
Steps to reproduce:
* Try to connect to an account with TOTP on the mobile app (v15+) => BUG
Refs:
[1] odoo/odoo@80d74e7ee0
[2] odoo/odoo@401fc7efe9
X-original-commit: 65dca67ecdcc2228d90781a9f5ccd99f290ada6c
Part-of: odoo/odoo#79182
The `distinct` keyword in query
```SELECT distinct res_id FROM mail_message WHERE model=%s```
is not strictly necessary for the correctness of the result, as
it will be inserted inside a sub-query that will be able to use
the main (model, res_id) index of mail_message.
For example, when the `has_message` field is used in a domain
by the website_livechat module[1], the complete query looks
like this:
```
SELECT "mail_channel".id FROM "mail_channel"
WHERE ("mail_channel"."active" = true) AND
("mail_channel"."livechat_visitor_id" = 112678387) AND
("mail_channel"."livechat_channel_id" = 1) AND
("mail_channel"."livechat_active" = true) AND
("mail_channel"."id" in (
SELECT distinct res_id FROM mail_message WHERE model='mail.channel'))
ORDER BY "mail_channel"."create_date" DESC LIMIT 1;
```
In this query, it's obvious that the `distinct` makes zero difference in
the results.
However, the presence of the DISTINCT keyword means that PostgreSQL will
factor the cost of applying that UNIQUE sort in the query planning, and
use MERGE JOIN strategy to avoid sorting multiple times (ok, it could
perhaps guess that distinct is useless here, but we asked for it.)
For a database with millions of mail messages, there can easily be
millions of hits for the generic "all res_ids for model" query, so
the cost of that part will be quite high.
The plan will then look like this (notice the "Unique" step and the cost,
730ms for the index scan + 200ms for the sort):
<details>
<summary>The query plan when `distinct` is used</summary>
```
QUERY PLAN
------------------------------------------------------------------------------
Limit (cost=151528.28..151528.29 rows=1 width=12) (actual time=1021.237..1021.239 rows=1 loops=1)
Output: mail_channel.id, mail_channel.create_date
Buffers: shared hit=767230
-> Sort (cost=151528.28..151528.29 rows=1 width=12) (actual time=998.799..998.801 rows=1 loops=1)
Output: mail_channel.id, mail_channel.create_date
Sort Key: mail_channel.create_date DESC
Sort Method: quicksort Memory: 25kB
Buffers: shared hit=767230
-> Merge Join (cost=3.01..151528.27 rows=1 width=12) (actual time=998.786..998.790 rows=1 loops=1)
Output: mail_channel.id, mail_channel.create_date
Inner Unique: true
Merge Cond: (mail_channel.id = mail_message.res_id)
Buffers: shared hit=767230
-> Sort (cost=2.44..2.45 rows=1 width=12) (actual time=0.043..0.045 rows=1 loops=1)
Output: mail_channel.id, mail_channel.create_date
Sort Key: mail_channel.id
Sort Method: quicksort Memory: 25kB
Buffers: shared hit=5
-> Index Scan using mail_channel_livechat_visitor_id_livechat_channel_id_idx on public.mail_channel (cost=0.41..2.43 rows=1 width=12) (actual time=0.035..0.039 rows=1 loops=1)
Output: mail_channel.id, mail_channel.create_date
Index Cond: ((mail_channel.livechat_visitor_id = 112678387) AND (mail_channel.livechat_channel_id = 1))
Filter: mail_channel.active
Buffers: shared hit=5
-> Unique (cost=0.57..143838.35 rows=614997 width=4) (actual time=0.033..993.210 rows=97187 loops=1)
Output: mail_message.res_id
Buffers: shared hit=767225
-> Index Only Scan using mail_message_model_res_id_idx on public.mail_message (cost=0.57..129884.36 rows=5581595 width=4) (actual time=0.032..730.233 rows=5586467 loops=1)
Output: mail_message.res_id
Index Cond: (mail_message.model = 'mail.channel'::text)
Heap Fetches: 17
Buffers: shared hit=767225
Planning Time: 0.471 ms
Execution Time: 1025.410 ms
(37 rows)
```
</details>
Now, if we remove the superfluous `distinct` clause, for the same
database, data volume, and result, the plan looks like this:
<details>
<summary>The query plan when `distinct` is not used</summary>
```
QUERY PLAN
-------------------------------------------------------------------------------------
Limit (cost=3.44..3.44 rows=1 width=12) (actual time=0.069..0.069 rows=0 loops=1)
Output: mail_channel.id, mail_channel.create_date
Buffers: shared hit=8
-> Sort (cost=3.44..3.44 rows=1 width=12) (actual time=0.068..0.068 rows=0 loops=1)
Output: mail_channel.id, mail_channel.create_date
Sort Key: mail_channel.create_date DESC
Sort Method: quicksort Memory: 25kB
Buffers: shared hit=8
-> Nested Loop Semi Join (cost=0.98..3.43 rows=1 width=12) (actual time=0.061..0.061 rows=0 loops=1)
Output: mail_channel.id, mail_channel.create_date
Buffers: shared hit=8
-> Index Scan using mail_channel_livechat_visitor_id_livechat_channel_id_idx on public.mail_channel (cost=0.41..2.43 rows=1 width=12) (actual time=0.020..0.020 rows=1 loops=1)
Output: mail_channel.id, mail_channel.create_date
Index Cond: ((mail_channel.livechat_visitor_id = 117513256) AND (mail_channel.livechat_channel_id = 1))
Filter: mail_channel.active
Buffers: shared hit=4
-> Index Only Scan using mail_message_model_res_id_idx on public.mail_message (cost=0.57..2.77 rows=10 width=4) (actual time=0.040..0.040 rows=0 loops=1)
Output: mail_message.model, mail_message.res_id
Index Cond: ((mail_message.model = 'mail.channel'::text) AND (mail_message.res_id = mail_channel.id))
Heap Fetches: 0
Buffers: shared hit=4
Planning time: 0.761 ms
Execution time: 0.095 ms
(23 rows)
```
</details>
Total execution time goes from 1000 ms to 0.1ms.
Reference: introduced by 9a01a2953f,
coming from #69812, which was fixing a performance problem.
[1] https://github.com/odoo/odoo/blob/9b224f35f45876c86dc34934379bfa9e8b3e2160/addons/website_livechat/models/website.py#L40-L44closesodoo/odoo#78186
X-original-commit: 3ab87a848c96b284eac3dbbd6f6f2a9ea971876a
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Before this commit, the server could return outdated information to the
client about the state of their own rtc session.
The server should not return information about the client's own rtc
session as the source of truth is the client-side state.
A case in which this was causing an issue was when a user toggled their
mute state right before their client pinged the server and received
outdated session information before their most recent state could be
sent to the server.
This commit fixes this issue.
closesodoo/odoo#78028
X-original-commit: fe991edd2bca98b58fc5a49494871475c79bc22f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit adds a feature where users can reply to messages of other
users, doing this will show a reduced version of the message that has
been replied to above the message once posted, clicking on this reduced
version will scroll to the original message and highlight it if that
message is already loaded.
task-2362251
closesodoo/odoo#77941
X-original-commit: cec2e69e832072dd699274187ddfa122e29d03f3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Before this commit, when an attachment is deleted, there is no notification and
other client do not update the attachment status.
task-2635516
closesodoo/odoo#77937
X-original-commit: aa4d7920574852d0543e22a30fc686a7d41f9867
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit will display the name of the current guest in the thread
view top bar and make it editable.
closesodoo/odoo#77936
X-original-commit: 659c6a83245a396054cf26c204a7fc72fbbb971f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Post a message in the channel each time a guest is added to members of
the channel.
closesodoo/odoo#77915
X-original-commit: bf6af9b629a07d04bf582987b5144a37fa31729e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Just putting code where it belongs, in sections about access rights / discord
API. After a lot of updated some cleaning is always welcomes. This prepares
future code renaming and improvements.
Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)
Part-of: odoo/odoo#77845
Before this commit if you found a message and wanted to open the related record you would need to find it manually by finding the right view and then using the ID stored on the message to open it.
By adding a smartbutton the user can quick-navigate to the related record in a second.
This allows for quickly finding and opening records which is usually handy when debugging things.
Ref Task-2660873
closesodoo/odoo#77675closesodoo/odoo#77803
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Step to follow:
- Create an Asset Models
- Set up the Fixed Asset Account:
Automate Asset -> Create in draft or Create and validate
Asset Model -> The one you have just created
- Create a Vendor bill
Account -> the Fixed Asset Account of the asset model created
Label -> insert a newline
Price -> (do not forget to set a price)
- Validate
- Go to the asset automatically created
- @ mention a user in the chatter
Cause of the issue:
The generated email subject comes from the record_name and it can
contain newlines
Email headers don't allow newlines and an exception is thrown here
https://github.com/python/cpython/blob/60b93d9e4922eeae25052bc15909d1f4152babde/Lib/email/policy.py#L143
Solution
Replace newlines by spaces in the email subject
opw-2522055
closesodoo/odoo#77712
X-original-commit: ed343998d39ff91a3f73cc8012be498d32c91b2f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
* = test_discuss_full
Before this commit if 2 persons are joining the call at the exact same time, the
join RPC of each will return the list of RTC sessions without the other person
included.
In more general terms, the server should actually rarely send the full state to
the JS (in this case "use the replace command") because there is no guarantee
that a concurrent transaction is not changing the data at the same time. In
other words, even the python is actually working with partial knowledge
relatively to the database.
Using a DB lock would guarantee it, but we don't want to lock tables and wait on
locks if there are alternatives. In this case it is acceptable to keep obsolete
sessions for a little bit longer, as long as they are cleared eventually.
closesodoo/odoo#77656
X-original-commit: d3a84172fc78f5783f75aa1155f1a25e4f9614b7
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, a user could DM a portal user.
Portal user are not supported and can't chat.
task-2632874
closesodoo/odoo#77568
X-original-commit: a7eda6d7314e7261ddda32620fae817f1d828bae
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment
By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).
There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).
We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.
To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.
This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
(for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
in order to see only one at once
- a floating select input to switch visibility of a particular logical
branching
Task-27033
X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
Issue
-----
Adding ('channel_partner_id', 'ilike', name) when searching for
mail.channel.rtc.session does not filter out any record
because the model mail.channel.partner does not define any _rec_name
only the name_get
Solution
-------
Implement a _name_search method consistent with the name_get
closesodoo/odoo#77369
X-original-commit: 6c731a75295bbc8107d08ac3ed5c3d01245c782d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
When a user without an email partner try to create a channel, an exception is
raised because he has no email.
This exception should not happen when creating a new channel.
task-2641660
closesodoo/odoo#77147
X-original-commit: 0970d8767ac27f9542bb3ad40a6f213f80f408d8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>