The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.
We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.
opw 2003197
closesodoo/odoo#33707
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Fine-tuning of 516f22c398.
This commit missed attachments that are linked to a mail.template,
which should be added to every mail sent using the template.
To make sure that we both fix the duplicates and the generation issue,
we add a test.
opw 2000515
opw 1998782
closesodoo/odoo#33653
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
We don't want to notify inactive followers,
especially in the case of oddobot that was considered
as a inactive partner in _notify_compute_recipients.
The computed recipient data for odoobot are
(pid:2 active:False pshare:True notif:None)
It was considered as a partner and notified by email.
This fix simply removes inactive partner from partner to notify.
closesodoo/odoo#31734
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
1) Configure both an incoming mail server and an outgoing one.
2) Install CRM.
3) Create a sale team, use the incoming mail address as mail alias.
4) Add a user with a valid email as follower of that team in the
chatter.
5) Enable developer mode, become super user via the developer tools.
6) Change the language of the super user to french.
7) You may want to modify the default gather/post time interval.
to receive/post email more regulary in the scheduled action.
8) Using an external mail client, send a mail to the incoming mail
address.
9) Let the two scheduled actions run by themselves.
10) The mail sent to the user has the "Lead/Opportunity" in english
wheras the rest of the email is in french.
opw-1917993
closesodoo/odoo#31034
Before this commit, when creating a partner automatically when creating
a message with a template, the company on the partner was wrongly set
After this commit, we try to retrieve the company from the model on the template
OPW 1934392
closesodoo/odoo#30893
As `formataddr` only accept strings as arguments, an exception was
raised when trying to notify a mailing list channel with followers
without email.
closesodoo/odoo#30492
Do not use the model `_description` field which cannot be translated. Use
the `display_name` of the corresponding model instead.
Moreover, `<t t-esc="'%s' % model_description or 'document'"/>` gives
`'None'`, while `'document'` is expected.
This adds a query to some tests, which is expected since `display_name`
requires information stored in the DB, while `_description` is defined
at the Python level.
opw-1908420
Before this commit odoobot was appearing twice in mention
suggestions when talking to odoobot.
The initial need to be able to ping odoobot from everywhere led to the
override of channel_fetch_listeners. This is not usefull anymore.
This fix simply removes this override to avoid this problem since we
don't have a real use case where we need to ping odoobot in another
channel.
Task 1907142
closesodoo/odoo#28791
This tour was broken since the following refactoring:
https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c
With this commit, mail_tour should work correctly, and
is automatically run on runbot.
Note that the tour is automatically run in the module `test_mail`,
so that the tips are not displayed by installing Discuss.
Task-ID 1912730
closesodoo/odoo#29040
This is related to revision
71f188082f
This is nice to have a meaningful explanation
for the user to understand why his mail is not sent,
this is better to not interrupt the mail queue when doing so.
Because of the above revision,
when the mail queue iterated on a mail failing because
of an ASCII encoding issue,
the mail queue was interrupted,
and on the next cron call it failed again and again
on the same mail, therefore leading to the mail queue
to never be processed.
Fixes#27804
When a record inaccessible by the user is linked
to a message in a channel accessible to the user,
Avoid to raise an access error due to this linked record.
Also need an aditional query in test query_count.
closesodoo/odoo#28312
Currently creating activities assigned to user not having to the document
raises an Error as people should not have activities they cannot handle
directly on a document they cannot access.
In some cases activities are created through business flow, like automatic
activities creation when creating leave requests. Assigning an activity
to someone that has no access to the document should not prevent from
creating the leave request.
This commit therefore does not check assigned user access on automated
activities to avoid having blocked business flows.
This commit is linked to task ID 1903484.
closesodoo/odoo#28139
Commit 356a421660 introduced a hook to avoid sending emails while
installing application data. However we have to carefully re-activate email
sending in tests that depend on them especially performance tests.
This commit also update performance counters to match the current state of
counters as it was not totally updated.
Commit linked to task ID 1902307.
When sending notifications by batch one notification email can be send
up to 50 people. For one mail_mail entry to handle 50 emails can be sent
as those are sent independently for each recipient.
In some cases a bounce may occur while the whole batch of recipients is
not completely mailed. In that case the mailgateway will update the
notification status to bounced. When the cron finishes to send the whole
batch of emails it tries to update the notifications of all recipients.
However as a notification has already been updated due to the bounce we
face a concurrent update, meaning the transaction is rollbacked.
Emails have been sent but notifications are not considered as sent as they
have not been updated accordingly. Next time the cron runs it will send the
same batch again, with probably the same bounce and rollback. We could
therefore face an email loop.
This commit add test for this use case.
This commit is linked to task ID 1893054.
Purpose of this commit is to use the newly introduced helper to create
test users in a quick way and reduce code duplication. A mail specific
helper tool function is defined based on the standard one defined in test
allowing to pass a custom context. It bypasses mailing features in order
to speedup the creation.
This commit is linked to task ID 1889703 and PR #27526.
When sending notifications by batch one notification email can be send
up to 50 people. For one mail_mail entry to handle 50 emails can be sent
as those are sent independently for each recipient.
In some cases a bounce may occur while the whole batch of recipients is
not completely mailed. In that case the mailgateway will update the
notification status to bounced. When the cron finishes to send the whole
batch of emails it tries to update the notifications of all recipients.
However as a notification has already been updated due to the bounce we
face a concurrent update, meaning the transaction is rollbacked.
Emails have been sent but notifications are not considered as sent as they
have not been updated accordingly. Next time the cron runs it will send the
same batch again, with probably the same bounce and rollback. We could
therefore face an email loop.
This commit fixes that by setting notifications to a transient exception
state. Notifications are locked, meaning bounced will have to wait for the
transaction to finish before updating them. That way the cron can run
safely on the whole batch and we avoid having emails loop. It has an impact
on query count as a search and write is performed in the send process.
This commit is linked to task ID 1893054. Done in collaboration with
@Xavier-Do .
Sending email to addresses containing unicode characters
cannot be parsed by python and result in a UnicodeEncodeError.
This PR catch that specific exception and output a meaningful
error message.
Decision has been taken to not trigger any error message
client-side has it would have needed modifications on some
sensitive low-level backend code.
To reproduce:
- Configure odoo so it uses an email server
- Send an invoice to a partner whoose email address contains
some unicode characters (exemple: æøåÇÀ@example.com)
opw-1892409
closesodoo/odoo#27804
Before this fix the creation of task assigned to admin was leading
to the creation of mails.
This is a generic fix to avoid to notifiy a user when he is add as a
follower when creating data from odoo data files.
closesodoo/odoo#27682
Purpose is to separate tests related to access rights (low level), base
activity features and mixin itself. It eases understanding of tests and
prepare future addition of tests.
This commit is linked to task ID 1856417.
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.
Related Task ID : 37311
This is done by adding a new field on mail.thread objects and setting it when posting a message with attachments on a model inheriting from mail.thread.
Was part of PR #26740
Was part of task #1880089
This commit is related to enterprise commit that replaced mail_push.
It is about:
[MOV] ocn_client: Odoo Cloud Notification for mobile push notifications
odoo/enterprise@7587be4663
Indeed counters are impacted by code located in enterprise because
those are "maximum queries" counters.
As ocn_client is an auto-install module enterprise runbot would
be broken if the counters weren't updated.
-remove margin
With the spirit of making tests determinists,
we can remove margins to have a real test of query count.
-mock random on assert query count
bus gc is triggered using random. Therefore, when send_many is called,
we have 1% chance to have more query. Mocking random.random to 1
will disable gc during query count tests (not during warmup).
Could be interresting to put gc collection in a cron latter
-add more info on querycount
Adding file and line number on query count failure/info will help to update
the query counts.
-update query count based on enterprise
Update all query count with enterprise values (exactly)
-normalize query counts with enterprise
voip module add a read on activity type (during create) in enterprise,
leading to one more query but also more information in cache.
Therefore, the next assertion will need one more query to access this data
in community.
Adding an access to activity type in the first assertion will allow
to have the same cache state in community and enterprise.
Task: #1878588
PR: #26476
1. Odoobot shouldn't talk to admin when demo data are installed
Odoobot will talk to a user on it's first connection, meaning that
a dev will see this chat window a lot. The state disabled is not a
real state but is explicit, the odoobot wont be initialized in this
case. It is still possible to test odoobot flow with demo user.
2. remove old odoobot image and update link
3. small improvements in odoobot answers
Update the query count to avoid the runbot to be randomly red
Temporary fix!!!!! Will need to check with in details what is the
cause of this.
Those are the changes for the second part of test
The current implementation of odoobot is stateless, making him a little dummy.
Adding a state on the user allow to be sure that the user don't skip a step,
or loop back to a previous step.
States also allows odoobot to repeat the question when the user don't give the
right answer.
A quick modification asked by FP before freeze, in order to change the field
type in time.
Purpose of this commit is to add possibility of rescheduling the assigned
user on automated activities. Currently rescheduling is limited to updating
the deadline. In some cases we want to be able to update the assigned
user of an automated activity.
Tests are added to avoid regression.
This commit is linked to task ID 1838956 and PR #25899.
Purpose of this merge is to improve onboarding of Discuss. This is done via
a wow effect and a bot to test the Discuss app; otherwise you have nobody to
talk to. Purpose is also to improve retention as "the best way to increase
retention is this: when the user invites someone, when this guy activates its
account, the user gets a push notification from the invited user that just
logged in; that way he will come back to Odoo and start discussing with its
colleagues.
Concerning your new best friend: it is not a dog but Odoobot.
See sub commits for more details. This merge is linked to task ID 1838588 and
closes PR #25075.
Purpose of this commit is to improve onboarding with a wow effect and a bot
to test the Discuss app. Otherwise new users have nobody to talk to. Retention
will be improved by both increasing interactions and onboarding of Discuss
features.
This commit adds a simple bot in discuss. It answers some questions, helps
users getting their hand on discuss and eases the onboarding.
In this version, the flow is quite simple, and only im_livechat adds some
logic in order to show canned response. The logic is contained in new
modules: mail_bot and im_livechat_mail_bot in order to keep everything
well separated. It also allows users to remove the mailbot if they do not
want to keep this functionality.
Odoobot will only answer if he is in the onboarding conversation (alone
with a user in a channel of type chat) or if a user pings odoobot.
Odoobot logic applies to both standard chatter / channel messages and
also transient messages (like help commands).
Specifications
* 2 minutes after first sign in, users will receive a direct chat from
Odoobot;
* make Odoobot an archived partner;
* scenario
* Odoobot: "Hello, I'm here to help you discover chat features. Try
answering me with an emoji :)";
* User: Send emoji
* Odoobot: "Great! :) Did you notice that you can also send attachments,
like a picture of your cute dog? Try it!"
* Odoobot: "Not a cute dog, but you get it :) To access special features,
start your sentence with "/" (I.E. /help)""
* User: /help
* Auto message then Odoobot: "Wow you're a natural! As a channel usually
contain a lot of users, you can grab the attention with a ping. Try to
ping me with @Odoobot!"
* User: @Odoobot lorem ipsum
* if Livechat installed
* add 2 demo canned response so it does not look weird (like "Hello, how
may I help you?" and "Have a nice day!")
* Odoobot: "Perfect! <br> Try to type ":" to use canned responses."
* User tries canned
* Odoobot: "Good, you can customize your canned responses in the live chat
application. <br><br> + réponse suivante"
* Odoobot: "There's 3 different ways in Odoo to interact with your
colleagues: via this chat window, [img of chat window] via the Discuss
application [img of Discuss app + icon on it] or via the chatter [img of
the chatter]. Aaaaand that's it! Enjoy discovering Odoo! :)"
* random answers to ping/bad answer
* "Mmmmh I'm not sure what you mean.. Can you try again?"
* "I'm afraid I don't understand. Sorry!"
* when someone pings @OdooBot with no reason: Odoobot: Yaaaay that's me!
[party emoji]
* fun stuff to add for some answer
* User: i love you / love
* Odoobot: Aaaaaw that's really cute but, you know, bots don't work
that way. You're too human for me! Let's keep it professional <3
* User: Fuck
* Odoobot: That's not a really nice thing to say, you know? I'm a bot but I
have feelings, ok?! </3
This commit is linked to task ID 1838588 and PR #25075.
We do not want inactive partners to be added as followers. Indeed this may
lead to unwanted notifications send as inactive partners are not easily
found in the various widgets. It also creates unnecessary data and
computation.
This commit has a small impact on performances as we choose to do it in
message_ subscribe method. Private _message_method is left untouched as
parameters given to this method are left to caller control.
This commit is linked to task ID 1838588.
Purpose
=======
As a server action could add followers on a record, here the goal
is to be able to add a next activity on a record.
Specification
=============
Based on the configured trigger, we can add a next activity on a record
by specifying :
- The activity type
- A summary
- A note
- A due date in x days/weeks/months
- A responsible