Commit Graph
203 Commits
Author SHA1 Message Date
Thibault Delavallée 07ae0ccc4e [IMP] mail: do not follow activities by default
Activities are quite personal and linked to daily jobs of people using it.
Being notified of all activities is therefore not considered as default
behavior and should be a choice done by users. Subtype linked to logged
activities is now not followed by default anymore. It is still configurable
through subscription widget or parent subscription (project/task for example).

This commit is linked to task ID 1824141.
2018-04-10 17:14:42 +02:00
XavierDo 6c381a3a16 [IMP] im_livechat, mail: replace emoji with unicode.
Remove the support to replace emojis by images. Most browser
now support colored emoji or at least black and white emojis.
The emojis list have been updated to ensure a correct support
for most os/browser.
Users have the possibility to install fonts localy if their os does not
have one of the default emoji font installed.
After default os emoji font, one of twemoji, emojione or noto color
will be selected.
The emoji list is now hardcoded in js in order to reduce the number of
records in shortcodes.

Also include a small fix for livechat to display message field when rating
is bad.

Task #36898
PR #23689
2018-04-09 17:19:29 +02:00
Dharmang Soni 807c4c3f5e [REF] mail, note: move reminder feature from mail to note
This commit refactors f488dc58c3 that added reminder feature in activities.
After merging it was suggested specifications were not correct and it has
been decided to move the whole reminder feature in note.

Reminders are now notes instead of activities. Now when having note appµ
systray proposes to create a note / reminder. A note.note record is created
with info given by the user. If a date is given in the systray quick create
then an activity is scheduled on this note.

This means user can create records in activity systray that are not
activities but notes used as reminders. Those will use the first availableµ
note column for the user.

As reminders are now notes the support of activities not linked to any
document is removed, as well as archiving activities and tests linked to
that behavior.

This commit has been not carefully tested nor in-depth reviewied. It is
considered as too important for the upcoming freeze. This closes task ID
1833628. Closes #24129 . Many thanks to @dpr-odoo for its quick development
and good work on this task.
2018-04-09 14:35:06 +02:00
Thibault Delavallée 60e5a887c5 [IMP] mail: set a sequence on activity data in order to at least have one 2018-03-27 13:26:41 +02:00
f488dc58c3 [IMP] mail: allow to use stand alone activities as reminders
This commit allows to create personal reminders and to manage them using
activities. It is done using activities not necessarily linked to a record
but only to a user. Reminders can be used for example as a personal todo
list.

Technically we choose to model a reminder as an activity related to no
record. This means having a void res_id and model. An activity type is
added to classify reminders in it.

Settings reminder as done is not done like classic activities. Indeed classic
activities are unlinked and a message is logged on the related document.
As there is no document for reminders those are archived instead. It means
an active field is added as well as an override of toggle_archive to update
systray counter.

Activities systray widget is improved to display reminders in activities
list. This entry leads to a kanban view of activities allowing their
management. It is also possible to create them directly from the systray
allowing a quick creation of reminders.

This commit is related to task ID 41745. Closes #22143 .

Co-authored-by: Dharmang Soni <dpr@odoo.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2018-03-27 13:26:41 +02:00
Christophe Simonis 0f57bdba72 [MERGE] forward port branch saas-11.2 up to 42659dc70c 2018-03-09 16:25:58 +01:00
Christophe Simonis 36945a5853 [MERGE] forward port branch 11.0 up to c2e878e34c 2018-03-01 19:43:25 +01:00
Martin Trigaux a546b34f52 [FIX] mail: use correct emoji for shortcode
:) is not the shortcode for 😊
:-) is not the shotcode for 😂
source https://emojipedia.org
2018-02-26 17:14:02 +01:00
Thibault Delavallée 2709ffe0e2 [IMP] mail: add new classy layout for email notifications
This commit adds a new QWeb layout mail_notification_light. It is a new
lighter template using more modern styling. Its purpose is to be used as
a basis for all future templates used in notification mechanism (chatter,
sale orders, ...). During some time all templates will exist separately.

Future commits will gradually improve or add various notification
mechanisms. This new template will gradually be used more often in order
to replace old ones.

Thanks to @est-odoo for its in-depth testing of the template.
2018-02-20 14:30:06 +01:00
Thibault Delavallée 94f2f6241b [FIX] mail: fix wrongly QWeb-converted bits of notification emails
Notification emails now use QWeb to be rendered instead of jinja-based
mail.template since 2f7593761c. Part of the notification emails was not working
anymore since its syntax was still using jinja. This commit fixes that.

This commit also removes strange ';' that should not be part of python code
as well as an unnecessary variable propagation.
2018-02-12 13:02:15 +01:00
Thibault Delavallée 2f6a661fe9 [REF] mail: add a secondary notification template in mail
Various modules use another template when sending notification emails
for some specific case. For example sending sale orders or invoices
using the 'Send by email' button encapsulates the content in a layout
different from the base one.

As all modules basically uses the same copy-and-pasted template we choose
to define another email template directly in mail.
2018-01-29 16:54:18 +01:00
Thibault Delavallée 0f301bec25 [REF] mail: move email notification templates to QWeb
In this commit we change notification templates used to render
notification emails from jinja-based mail.template to pure QWeb
templates.

There are several reasons to do so

 * those are not real mail.template records. Indeed they cannot be used
   outside of the notification process as some values are computed
   and not available on the mail.message record used to render the
   template;
 * we do not really need other fields than body. Indeed fields like
   subject, email_from or email_to are computed from the notification
   process;
 * we do not want people to update the mail.template without knowing
   the consequences, especially for fields like recipients that may
   broke the mail gateway;
 * using the html editor easily break the mail.template as it is very
   custom and very to break without really realizing it.

It also simplifies template management as it lessens number of mail
template people have in their list view of mail.template. It avoids
mixing technical and functional templates.

We move to QWeb templates as those are not too hard to customize and
allow to perform body rendering which is what we really need when
notifying people of a new message.

This commit does not change the functional purpose and layout of the
templates. Behavior should be the same before and after this commit.
2018-01-29 16:48:23 +01:00
Thibault Delavallée 11d2d30e91 [REM] mail: remove follow / unfollow buttons in notification emails
Notification emails contain a link allowing to follow or unfollow
documents directly from the notification email. However there are
several issues with this button

 * it require people to login to follow or unfollow documents;
 * it is not linked to the email;
 * if the customer does not have a login it is not possible to perform
   the action;
 * there is no confirmation step;

This commit removes the follow / unfollow button in the notification
emails. Indeed as people have the "Access document" button there is
only one more click to perform in order to subscribe or unsubscribe.
Concerning customers adding a complete control of the follow mechanism
would be costly in term of code and access rights checks. We therefore
decided to remove this button.

It also allows to simplify a bit the notification process as there
are less parameters to take into account when grouping recipients. It
allows to lessen the number of required template rendering when sending
notification emails.
2018-01-29 14:19:53 +01:00
Thibault Delavallée fdb7a8db26 [FIX][IMP] mail: remove cdata of notification email data and fix some invalid stuff
Using xml type it allows to have a cleaner view of the content in a classic
code editor. This commit also fixes some xml-related invalid stuff that
does not impact the notification email rendering.
2017-12-28 12:39:54 +01:00
Christophe Simonis 10128fa7e8 [MERGE] forward port branch saas-16 up to dc2a6c6cd2 2017-10-20 19:27:04 +02:00
Christophe Simonis 5ea0f55d65 [MERGE] forward port branch saas-15 up to bee0c11ef7 2017-10-20 17:57:21 +02:00
Christophe Simonis bee0c11ef7 [MERGE] forward port branch saas-14 up to f3ac68ed29 2017-10-20 17:24:15 +02:00
Christophe Simonis f3ac68ed29 [MERGE] forward port branch 10.0 up to e2532f855f 2017-10-20 16:09:28 +02:00
Nicolas Martinelli e414bae770 [FIX] mail: company logo
- Activate multi-company, create companies A and B
- Set 2 companies on a user

When a message is sent (for example, thanks to the chatter), the
notification email always contains the logo of the same company,
whatever the company of the user or the company of the object.

This is a complement of commit 7a03f9ce93, applied to notifications.

Closes #20088
opw-772405
2017-10-20 10:41:24 +02:00
HIRAL BHAVSAR 3285a0384c [FIX] mail: Wrong codepoint for angry emoji. 2017-10-17 17:23:30 +02:00
Rohan Patel 8c1f6a7cc6 [IMP] mail,*: replace emojis by unicode in chat messages
*im_livechat,rating.

Emojis are now encoded in unicode characters in messages. This
allows to copy/paste messages including emojis, ensures that
emojis are properly displayed in mail interfaces (at least those
that support unicode, e.g. GMAIL, counter-example: outlook), and
allows the user to directly use emojis of its smartphone in mobile.

This commit also adds several new emojis.

PR #11095
2017-09-11 12:20:49 +02:00
Fabien Pinckaers 32f4888cce [IMP] mail: no default text for activity types. Avoid bug when changing activity 2017-09-06 21:40:26 +02:00
Fabrice Henrion 87217da66a [IMP] mail: update demo data
To new SF phone number
Closes #16711
2017-05-09 13:05:07 +02:00
Jérome Maes 1f3da58cfe [MOV] base,portal: make portal module empty
The goal is to prepare the removal of
'portal' module.

- demo portal user is moved into base
- 'is_portal' field on res.group too
- remaining security rule are moved to base too
- mail template is moved to website_portal
2017-03-23 09:59:58 +01:00
Aline Preillon 2950ffaa86 [IMP] mail: improve notification management, either email either inbox
Currently partners have a boolean field to choose whether to receive
notifications only in their Odoo inbox or to receive them in their inbox
and by email. This leads to several issues :

 * if a customer is configured to not receive emails he will not receive
   any notification on sales orders, leads, ... This is not clearly
   indicated to the salesman and it is not easy to know how to change
   that behavior
 * if an user chooses to receive emails and does not use its inbox a lot
   of notifications stay in Odoo. The user has to manually set them as
   done to make them disappear which is redundant.

This commit changes that behavior. From now on customers will always
receive all notifications by email. Indeed Odoo is not a customer oriented
mailbox. Moreover sales orders or discussions on leads send to customers
should always be sent by email as it is the standard communication
mechanism. Users will be able to choose to receive notifications in Odoo
or by email. The choice is no longer inbox or inbox + email, but inbox
or email. Choosing one option or the other one depends on the way the
user wants to work.

Technically the field is moved on the users model and selection keys
are renamed. Notification process is modified

 * notified_partner_ids contains as before specified recipients as well
   as followers matching the subtype
 * customers and users working with emails are notified. During that
   process customers notifications are marked as done to be able to
   track the email state without having needaction. Users notifications
   are currently deleted as we do not track their email state.

The removal of partner field implies changes in various addons that
define partner data with this field set in the values.
2017-02-21 16:42:11 +01:00
Thibault Delavallée 21720f0a3f [FIX] mail: slighty improve notification email layout
* Limit company image to match buttons size and avoid badly
   sized image
 * Add a margin below internal note notice because it currently
   overlaps with actual email content
 * Avoid having signature direclty included in message by
   enclosing body in a div
2017-02-21 10:39:42 +01:00
mmo 33b09d0d5e [IMP] generic: Open external links in a new tab by default
Purpose
=======

External links in the data sometimes open in the same tab, the users loses times as he has to come back (and looses the context).

Specification
=============

Any external links in data (planners, settings) should open in new tabs.
2017-02-10 14:29:29 +01:00
Thibault Delavallée 1c79c5ee30 [REF] ir_cron: make scheduled actions inherits from server actions
The purpose of this commit is to handle code execution only in server
action and delegate schedule management to ir_cron model.

ir.cron model now inherits from ir.actions.server. Fields model, function
and args are removed as well as the logic to handle them. There is no
more code manipulation and evaluation in ir_cron, only a call to the run
method of ir.actions.server.

Cron form view use server action form view as primary view. This way
automated actions use the same base form as server actions with
cron details added.

Thanks to @fpodoo for the original idea and preliminary work. Thanks to
@jpr-odoo for first developments. Thanks to @jem-odoo for reviewing.
2017-01-03 19:11:07 +01:00
Denis Vermylen (dve) eed8a34686 [IMP] crm_*, sale_*: sales channel dashboard
Functional
        ==========

Sales teams become sales channels. Their dashboard cards now include a graph
displaying customizable data for managers (comparable to those in accounting).

By default, you now have the following sales channels (non-demo):

      Direct Sales      (with installation of crm or sale)

  Sales Channel type: Sales
  Works same as before, what's changed is:
    - their cards display one big button directing to the start of their
      workflow
    - the links on the right-hand side have been reworked, and are only
      displayed when there is at least one item requiring attention.
    - 'More' tab remains unchanged.

      Website           (with installation of website_sale)

  Sales Channel type: Website
  Differences lies in the links displayed in the dashboard card:
    - it displays abandoned carts, awaiting payments and payments to capture
  Default Channel linked to all sales made from the eCommerce.

      Point of Sale     (with installation of sale and point_of_sale
                                              -> auto-installs pos_sale)

  Sales Channel type: Point of Sale
  Linked to pos.configs and their pos.sessions and pos.orders.
    - only links to their linked pos.config dashboard and open sessions
    - can't use opportunities, lead or invoicing and can only display
      pos.order data in the graph.
  Default Channel linked to the default pos.config.

        Technical
        =========

- Add a channel type: sales, pos, website that have different actions/settings
- Add a graphs to the kanban cards in the sales/crm dashboard, configurable in
  the form view in the new dashboard page.
- Rename sales teams to sales channels, rename and add default and demo sales
  channels
- Change dashboard links depending on the channel type and add a related
  computed fields on crm.team
- Rename strings and improve channel form view.
- Leads are now checked by default once activated for 'sales' type channels
- Disable checking "leads" without using "opportunities".
- Hide invoicing and invoicing target depending on channel type.
- Move currency_id to sales_team
2017-01-03 19:04:34 +01:00
Ravi Gadhia 60bacefd01 [IMP] mail: add activities allowing to define next actions on various models
This commit introduces generic activities to use in your addons. Activities are
actions user have to take on a document like making a phonecall or organizing
a meeting. Activities come with the mail module as they are integrated in the
Chatter but are not bundled with mail.thread.

New models are

 * mail.activity.type: used to categorize activities. Each type is a different
   kind of activity e.g. call, mail, meeting. An activity can be generic i.e.
   available for all models using activities; or specific to a model in which
   case res_model_id field should be used.
 * mail.activity: an actual activity to perform. Activities are linked to
   documents using res_id and res_model_id fields. Activities have a deadline
   that can be used in kanban view to display a status. Once done activities
   are unlinked and a message is posted. This message has a new activity_type_id
   field that indicates the activity linked to the message.

This commit introduces a mail.activity mixin to use in various addons that
enables the activities feature. It works like the mail.thread mixin. It defines
a activity_ids one2many field toward activities using res_id and res_model_id.
Various related / computed fields are also added to have a global status of
activities on documents.

Activities come with a new JS widget for the form view. It is integrated in the
Chatter widget although it is a separate widget. It displays activities linked
to the current record and allow to schedule, edit and mark done activities.
Use widget="mail_activity" on activity_ids field in form view to use it.

There is also a kanban widget defined. It defines a small widget to integrate
in kanban vignettes. It allow to manage activities directly from the kanban
view. Use widget="kanban_activity" on activitiy_ids field in kanban view to
use it.

Next commits will aim at integrating activities inside main Odoo addons.

Thanks to R&D India for their work and testing on this task. Thanks to belgian
Usabiliteam for reviewing and testing it. Thanks to @jem-odoo for the final
review. May his soul lie in peace with the trumpets of paradise.
2016-12-21 10:56:15 +01:00
qsm-odoo fb363b572b [FIX] *: adapt odoo interface violet
Change color #a24689 to #875A7B

Commit https://github.com/odoo/enterprise/commit/8ac1c19fac7615fecd51e670f798d13158a4e53c
changed the odoo interface violet by changing the main LESS variable
but forgot there was many direct occurences in XML/HTML/... (for
example for the mobile browser color).

Even if it's community the odoo interface violet is used at many places
(module description, XML demo data, ...).
2016-10-05 10:29:00 +02:00
Thibault Delavallée 458aaca328 [IMP] mail: reimplement grouping of notification recipients
There is now a single method easier to inherit to add specific behavior
for the display of access button as well as actions buttons. All addons
using this mechanism are updated accordingly.
2016-09-23 10:01:41 +02:00
Thibault Delavallée fcb51faa9f [FIX] mail: fix display of actions button in notification email 2016-09-23 10:01:41 +02:00
Thibault Delavallée 2ae09150a5 [REM] mail, forum: remove hack to add buttons in forum notifications
It has been solved using the standard way of managing buttons in notification
emails. At least we hope it.
2016-09-01 13:27:49 +02:00
Thibault Delavallée 9c1af690d5 [IMP] mail: bounce management
Handle bounces using bounce alias directly in mailgateway. Previously bounces
were used only in mass mailing to update campaign statistics. Now the
mailgateway tries to find data from standard delivery status emails. This
data is used to update state of emails sent to customers, to display it in
the Chatter. It is also used to increment the message_bounce counter on the
bounced partner and bounced record, if any and if the field exists.

Previous more generic code that detect bounces is kept. This code is more specific
to standard delivery failure notifications by parsing its content.
2016-09-01 13:11:49 +02:00
Thibault Delavallée 97425bfe3f [REF] various: make mako mail templates more xml compliant
As we will soon improve the sanitizer we will be able to sanitize email
templates body. However this implies some cleaning in the templates to
be sure mako is not considered as invalid html / xml and therefore removed
from the template body.
2016-08-30 15:54:55 +02:00
Thibault Delavallée efd55ab8a5 [REF] various: rename openerp node to odoo in xml files 2016-08-10 15:48:10 +02:00
Christophe Simonis 523d3af131 [MERGE] forward port branch saas-12 up to 16d65a8 2016-07-29 17:55:21 +02:00
Christophe Simonis cfb0c0dead [MERGE] forward port branch saas-11 up to 7ae5121 2016-07-25 17:17:15 +02:00
Thibault Delavallée c70e2a5777 [FIX] mail: display access button on discussion emails if recipient can see the document
Currently no access button is displayed if the email is a discussion and has
no contextual actions like creating a new document, or setting the responsible
of the document. However it leads to emails being sent without access button.
This can be extremely frustrating and make the notification email quite
impossible to use efficiently.

With this commit when an user has access to a document the link to the document
is always displayed in the notification email.
2016-07-19 16:35:05 +02:00
Fabien Pinckaers 069a192d69 [IMP] mail: Improved email notification template
Shorter template, cleaner look. Warn about internal note messages.
2016-07-16 23:57:55 +02:00
Fabien Pinckaers 20dbf9190d [FIX] mail: wrong message on general channel 2016-07-11 09:57:30 +02:00
Mansi Gandhi 0abd35fbfb [IMP] mail: Notification email template header buttons order
On emails sent from tasks, the button "View Task" should be the main
Call to Action (primary), not New Task (that should be link like unfollow):
2016-06-16 14:09:46 +02:00
Goffin Simon ca8a38d201 [FIX] mail: forum reply shows as 'False'
When posting a comment after an answer in the forum, a mail
was sent to each subscriber with 'Re: False' as title.

In fact the title has to be 'Re:' + the name of the parent
record of this message.

When a mail is sent from the post, a link to access the subject
of the forum must be included in the mail.

opw:679073
2016-06-14 14:44:58 +02:00
Christophe Simonis ddb0fb2739 [MERGE] forward port of branch saas-9 up to 59d3f63 2016-03-24 16:53:45 +01:00
Denis Ledoux 6e09293b7d [MERGE] forward port of branch 9.0 up to 8e69043 2016-03-11 11:42:43 +01:00
Yannick Tivisse f6c0418a80 [IMP] mail: Send plaintext emails on discussion with external user/partner
When there are no available action buttons on the email (as Follow, View Task,
Convert to Opportunity), i.e. when the user/partner is not an employee, and
when the message subtype is 'Discussion', send a plaintext mail instead of
a formatted one.

Use case: Strange to receive a mail like this when you're on a lead and you
receive formatted mails.
2016-03-07 15:55:53 +01:00
Thibault Delavallée cb8c2d2b7e [IMP] tools: sanitizer: quote detection
Quote detection is now done in the sanitizer itself. It tags nodes that are
inside quotes (signature, text quotes, email quotes). The purpose is to remove
html_email_clean and have all the html cleaning / sanitizing inside a single
function. When a node is tagged, data-o-mail-quote is set on the node.
This attribute is added in the whitelist of valid attributes for the
sanitizer.

[REM] Support of shortening messages. The read more / read less will only
display or hide detected quotes and signatures. Shortening messages above
a given amount of characters is not supported anymore. Indeed it adds much
complexity to the sanitizer without adding much value to the result. The
primary purpose of the sanitizer is indeed to remove noise and unnecessary
content.

[TESTS] a lot of test are not necessary anymore, as read more / read less
display will be moved in the front-end and as the shortening has been
removed.Tests have therefore been cleaned and simplified.

[DEMO] mail: small demo update to include a bit quote detection
2016-03-03 15:44:56 +01:00
Christophe Matthieu 1320ad8cfe [FIX] mail: button_access is undefined in mail template preview
opw-668409
2016-03-03 15:41:02 +01:00
Denis Ledoux 85b39df834 [FIX] mail: odoo link in notification email
This is the forward port of the below revision:
135ad9e954

That should have been done in the below forward-port:
c298cf3250

opw-667335
2016-01-21 17:39:05 +01:00