Commit Graph
120 Commits
Author SHA1 Message Date
Thibault Delavallée 8ff7973e79 [FIX] base, mail: allow to use templates with reports
Since de4213b771 it is not possible to anyone except admin to use templates
with a report defined on it. This could be annoying.

X-original-commit: 47f5e14eca4e13010cc11f688ea92f65a2695d38
2020-08-24 08:14:43 +00:00
ryv-odooandThibault Delavallée 186cfb5ebd [REF] mail: make alias mixin multi-enabled
Purpose of this commit is to allow multi-create in alias mixin by correctly
creating / updating aliases in batch.

Task ID 1919277
Community PR odoo/odoo#41160
Enterprise PR odoo/enterprise#6983
Upgrade PR odoo/upgrade#872

Co-Authored-By: Rémy Voet <ryv@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-04-17 06:52:09 +00:00
Tiffany Chang (tic) f9ff21a200 [IMP] mass_mailing_(sms): Add unblacklisting button
Previously a blacklisted phone number or email address could only be
removed from their respective blacklist by going to the corresponding
blacklist view [in mass_mailing_(sms)] and manually
archiving/deactiviting the entry. All users could see that an email was
blacklisted via an fa-ban icon added next to their corresponding field
in the modules: crm, mass_mailing, mass_mailing_sms, and contacts (via
extension).

This commit adds additional fa-ban icons next to blacklisted phone
numbers and makes all instances of these icons clickable to remove them
from their corresponding blacklist using a wizard. There are several
limitations to this implementation including:

1. If both a mobile and phone number field appear within a crm lead
instance, then only the mobile field will indicate if it is blacklisted
(due to current implementation of PhoneMixin which only checks 1 phone
value against the blacklist and "sms" which returns mobile numbers first).
I.e. if a phone field value is blacklisted, but a value is typed into the
mobile field, then the phone field will never indicate that it is blacklisted.

2. If someone clicks on a unblacklisting icon after changing the
corresponding field value without clicking off the field input, then the
latest typed in value will be the one submitted for unblacklisting,
which may not actually be blacklisted (due to "is_blacklisted" flag
being a computed field and it not having a chance to re-compute to hide
the button).

3. If someone changes values in the blacklist, then someone who already
has a form open will not see icon disappear until something triggers a
re-compute of the "phone_sanitized_blacklisted" flag (this was already the
case with the icon, but now a user may try to unblacklist a value that is
already unblacklisted.)

4. Since the icon needs to be visible by everyone to indicate whether or
not a phone/email is blacklisted, users without corresponding unblacklist
permissions will be able to click on the icon. When they click on it, they
will be informed they do not have permission to unblacklist. A wizard was
determined to be the best way to implement this unblacklisting for the
following reasons:
  - A "Unblacklisting Reason" is needed and will not be stored as a field.
  - A field widget is unable to do this due to security settings +
    inability to refresh view after unblacklisting with a
    "Unblacklisting Reason" without wiping unsaved changes.

Additionally, to better align with GDPR, the corresponding form view for
the phone/email blacklist has been updated to use the same wizard to
track "Reason for unblacklisting". Unfortunately there is no
straightforward way to prevent direct "Archive" action, so users are
still able to bypass unblacklisting without being asked for a "reason
for unblacklisting".

Supports task: 2117635
Upgrade PR: odoo/upgrade#939
COM PR: odoo/odoo#45315
2020-03-26 10:15:18 +00:00
Victor Feyens a3ded9043d [IMP] *: declare ir.rule in noupdate
ir.rule are default values but can be customized based on the
company's policy and needs.
This is typically a record that is in noupdate as should be
customization-friendly.
2020-03-20 16:21:25 +01:00
Victor Feyens 532c083cbb [IMP] *: remove global field definition in ir rules xml
It is a computed field, there is no need to manually set its value.
2020-03-20 16:15:40 +01:00
Martin Trigaux 65530dfd6a [ADD] *: add ir.model.access on all transient models
Following changes needing ir.model.access on transient models too.
Remove groups declaration on the action to move it to ir.model.access
when possible.
Rules are strict by default with no unlink access by default and high
priviledge asked. Adaptations may be needed later.
Write access is given as a wizard may need to be modified in case the
action triggers an error and the user has to correct a value

account*: use account.group_account_user for all transient by default
	  remove account.print.journal relic
stock*: use stock.group_stock_user by default
survey: survey user can send invitations
mail: allow any employee to execute wizards
      additional verifications are made to ensure they are executed
      only on the documents the user has access to you
      give portal access to mail.compose.message as portal still does
      some actions like posting messages on the forum
      add ir.rule to avoid reading somebody else messages
      increase the query count because of undeterminist count
crm: saleman for lead2opp, manager for massmailing
     partner manager for actions linked to partners
     avoid a write in test_lead_lost
sms: any employee can send sms
mrp: mrp user can execute wizards
     give unlink access as making write during do_produce operation
base_import: employees can import files
delivery: stock user can deliver
event_sale: sale user can configure the wizards
	    event user inherit from  sale rights
gamification: employee can give badge
google_service: resolve FIXME
hr: add specific rights
    manager can set a plan according to group on button
    anyone who can write on an employee can register a departure
hr_expense: set rights based on buttons
hr_holidays: an approver can make a summary report
hr_recruitment: recruiter can refuse a candidate
hr_timesheet: can use the wizard if can create a timesheet
l10n_eu_service: managers can create fiscal positions
mass_mailing: same group as on mass.mailing.list
membership: accountant can create invoice from membership
payment: accountant can create a link
	 as the source is an account.move
	 keep the payment.acquirer.onboarding.wizard to system user
	 only as it is called during company configuration
point_of_sale: PoS manager only can use wizards
	       never create closing_balance_confirm_wizard records
product_expiry: stock user has rights on stock.picking
product_margin: access from accounting menus
repair: same rules as for above models
sale: set ir.rule for self wizard only
      add rule from model introduced in payment to add salesman group
sale_crm: saleman can create a quotation from a lead
sale_coupon: any saleman can generate coupon
	     add self ir.rule
sale_product_configurator: salesman can select product variants
snailmail: employee can send letters
website: designers can write on website
website_crm_partner_assign: same rule as group on action
website_sale: sale ACL as for payment.acquirer.onboarding.wizard
website_slides: anyone can send invitation

base: base.language.*: allow employee (cf lang_install)
      change.password.user: can not read change password wizard of
      other users
      test.*: no access is needed

Courtesy of Damien Bouvy, William Andre and Antoine Prieëls for review
of acl
2020-02-04 17:54:18 +01:00
15c934a1ab [IMP] (website_)mail: improve routes and management of mail followers
Purpose of this commit is to improve model of followers, notably management
code and its use in routes. Indeed it is quite an old model and code had
to be cleaned a bit to improve code readability and maintenance.

In this commit we

  * remove unnecessary code examples in gamification about followers: using
    that model as example of code for goals is probably not a good idea as it
    is technical;
  * rewrite routes called by JS are simplified to better match JS
    implementation;
  * introduce computed fields to fetch related partner or channel name,
    email (partner only) and active status;

LINKS

Task 1933771
Task 2078313

closes odoo/odoo#39808

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Remy Voet <ryv@odoo.com>
Co-authored-by: jgi-odoo <jgi@odoo.com>
Co-authored-by: Xavier-Do <xdo@odoo.com>
2020-01-21 16:40:06 +00:00
mcm-odoo fea8d452b2 [FIX] im_livechat: allow manager to read all sessions
Managers could see only their sessions like other operators.
Now they can see all the sessions so they can check and help the operators.

task-2048498

closes odoo/odoo#41175

X-original-commit: 6ae791335a1986aa4cc72f7ed9aadd471c1774c5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-22 14:27:10 +00:00
Thibault Delavallée 69ccabb212 [FIX] mail: restrict access to mail.mail model
From now on mail.mail is considered as a technical model. Indeed people should
not really manually craft mails by hand. Instead various functional flows
should either send mails, either craft mails based on some user input.

We therefore make mail restricted to admin users. Flows creating mail.mail
are updated to use sudo, and ensure it was done in a context that makes
sense to delegate this power to the user.

Task ID 1853147
PR #32243
2019-11-29 13:35:14 +00:00
Christophe Simonis d74b451805 [MERGE] forward port branch 13.0 up to f4105eb9c7 2019-10-09 02:08:17 +02:00
Luis González 13e14cf764 [FIX] board,mail,project: remove spaces from external IDs
This was already performed on 3c568aec0b, but there still are some
remnants on model access records.

Fixes odoo/odoo#25408
Closes odoo/odoo#37946

closes odoo/odoo#37958

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-04 08:51:01 +00:00
Thibault Delavallée 60f9c85a8c [FIX] mail: make mail.mail an internal model by default
Task 2078313
2019-09-03 14:01:00 +02:00
Thibault Delavallée abc212f59a [REF] mail: remove create_user_id field on activity
As activities are created using the current user there is no need anymore to
have another field to store the activity creator. We can therefore remove
create_user_id and replace its use by the magic create_uid field.

This commit is linked to task ID 1856417 and PR #27619.
2018-12-12 12:45:24 +00:00
Sébastien TheysandThibault Delavallée b9c8ba83e6 [IMP] mail: clean activities access rights
This commit improves code of access rights checks when creating or updating
activities. Several points triggers this commit

 * we would like to use _filter_access_rules and override it on activities
   model in order to be more standard;
 * we would like to get rid of sudo used in various CRUD overrides as using
   standard ORM method allows to correctly use current user;
 * we would like to get rid of create_user_id field once we can keep the
   current user as create_uid;

Access rights are a bit updated. They are now the following

 * you can create activities for documents like posting messages (using
   _mail_post_access attribute; if not defined, write access on document
   is required);
 * you can read activities for documents you can read;
 * you can write and unlink activities either following the defined access
   rule (created OR assigned), and otherwise like posting messages (
   using _mail_post_access attribute; if not defined, write access on
   document is required);

In this commit we also hide edit / mark as done / cancel buttons for
activities the current user cannot modify.

This commit is linked to task ID 1856417 and PR #27619.

Co-Authored-By: Sébastien Theys <seb@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2018-12-12 12:44:03 +00:00
Gert PellinandRichard Mathot 76a557c9ac [IMP] hr,mail: auto-subscribe departments to channels
Purpose of this commit is to allow to make private channels linked to
an HR department with an auto subscription.

It will ease the use of discussion channels among employees of a given
department. Moreover auto subscription is useful to avoid having to
manually synchronize channel members and department members.

This commit is linked to task ID 1848526 and closes PR #26650 .

Co-authored-by: Gert Pellin <gpe@odoo.com>
Co-authored-by: Richard Mathot <rim@odoo.com>
2018-09-17 13:56:39 +02:00
David Beguin 98ce81cac5 [IMP] mail - mail.blacklist: Not send mass_mail to recipient that does't want to
Purpose
=======
Improve mailing subscription to be more compliant with the European GDPR law.
Keep a list of people who does not want to receive promotional emails
(or mass mailing in general) anymore.

Specifications
===========
This commit is regrouping some main changes on mass mailing.
- Added blacklist : Avoid sending mass mailing to blacklisted recipient
  (blacklisted = email address that doens't want to receive mass mailing anymore)

Detailed implementation
===================
Mail :
- Add Blacklist mechanism in mail module (NOT in mass-mailing) :
  as we can send mass-mail without the mass-mailing module
- Unicity in email -> To avoid error in import, override the create and return
  the existing record if any, else, create the record normally.
- Blacklisting is done by email address and is cross model.
  Will apply to model that inherit the blacklist.mixin.
- field 'is_blacklisted' -> computed : check if email is in blacklist
  + search method to be able to filter on is_blacklisted
- When a email address is blacklisted, it will never get mass mailings anymore.
  Even if the email address is added to another mailing lists
- Avoid sending notification to blacklisted recipients when sending email
  in mass mail mode. If the recipient is blacklisted, we should not even send a
  notification in the recipient's chatter for an email that he won't even
  receive.
- When a email address is blacklisted, it can still get 'normal' mailings.
- The blacklist shoud be accessible in
  Mass Mailing / Configuration / Blacklist
  and Settings / Technical / Email / Blacklist
  -> Renaming Settings / Technical / White / Black List config menu item
     into Channel Moderation to avoid confusion with Mass Mail Blacklist
- Add indexes to the blacklist table (on email) to make it fast for access for
  the different use cases
- _primary_email : attribute that must be overriden to specify which field must
  be used as email in the blacklist mechanism.
- Filtering the blacklisted recipient in mail composer :
  done in mail._get mail value()
  In case of real mass mailing, we need the statistics to be computed in order
  to know how many recipients were ignored in the mail.
  So we cannot avoid sending mail but instead flag the mail as canceled.

Task ID 33224
2018-08-10 17:46:08 +02:00
Mathieu Duckaerts-Antoine 299ebb2cdf [IMP] mail: add moderation on channels
Purpose of this commit is to allow moderation on incoming messages in
discussion channels. On some channels on which moderation is required
messages should be in a pending moderation stage. Moderators can accept
or refuse messages as well as always allow or ban messages coming from
a given set of emails.

Channels now have an option to be moderated. Moderators can be added on
channels. They have access to a specific UI in Discuss to see and take
action on messages waiting for moderation.

Concerning mail.thread message that are pending moderation are not notified.
It means nobody receives a notification about them. Moderation process calls
the notification once the message is validated.

Various features included in this commit :

 * a model is added to store the decision about emails, allow or ban;
 * access rights are updated so that only moderators can modify moderation
   fields on message;
 * specific bus notifications are send to moderated people as well as to
   moderators on incoming emails as well as when a decision is taken;
 * options are added on channels to send explanations to moderated emails;
 * options are added on channels to write and send guidelines explaining
   why and how moderation is performed;
 * a reminder is send daily to moderators with remaining messages to moderate;
 * discuss UI is adapted and a new channel is added below Inbox and Starred
   giving access to moderation tools;
 * chanenl UI is adapted allowing to moderate directly inside channels;

This commit is linked to task ID 29521. Closes #21921.
2018-06-06 16:01:33 +02:00
Thibault Delavallée 81d98f32a5 [IMP] mail: improve activity types behavior and access rights
First purpose of this commit is to limit access on activity types.
Employees can now only read activity types. Indeed defining or modifying
activity types should not be done by employees as it impacts daily work
of all other employees. Specific app-based rights are added for project
and sale managers. Those have a specific menu to configure activity
types, meaning they should also have the access rights to do so.

Also including :

 * ease default computation for res_model_id of activity types: using
   default_res_model in context it is possible to specify a default
   res_model_id. It is useful for example to give a specific context
   in configuration menus;
 * add a domain on res_model_id field in order to limit it to models
   inheriting from mail.thread and not being transient;
 * various improvement in activity type form view to ease configuration
   notably the # days renamed to planned in;
2017-12-22 10:30:02 +01:00
Christophe Simonis 2f99470458 [MERGE] forward port branch 11.0 up to c201cf2b77 2017-12-01 12:55:02 +01:00
Christophe Simonis 42264d8dcb [MERGE] forward port branch saas-16 up to 5d7ad2b16c 2017-11-30 18:43:08 +01:00
Christophe Simonis 98539336a5 [MERGE] forward port branch saas-14 up to b780e4a0e4 2017-11-30 14:44:49 +01:00
Christophe Simonis b780e4a0e4 [MERGE] forward port branch 10.0 up to ba73fd534d 2017-11-30 14:13:39 +01:00
Christophe Simonis ba73fd534d [MERGE] forward port branch 9.0 up to fe4bb49b21 2017-11-30 13:55:01 +01:00
Thibault Delavallée fe4bb49b21 [FIX] mail: fix wrongly duplicated access right 2017-11-30 12:55:48 +01:00
Thibault Delavallée d040bfde89 [MOV] (test_)mail: move tests into their dedicated module
Purpose: avoid having useless tables for test models in a
production environment.
2017-11-29 10:11:15 +01:00
Thibault Delavallée de25767ffc [IMP] mail: tests: improve / add common classes and data for mail tests
This commit improves common classes and add helpers for mail tests.
Future commits will use this new stuff to improve the tests.

 * improve existing models and add some of them. There are now several
   models

  * mail.test.simple: chatter-enabled record without any really advanced
    feature. Can be used everywhere standard chatter and communication
    tests are required;
  * mail.test.track: chatter-enabled record with basic value tracking
    and responsible tracking;
  * mail.test.activity: chatter-enabled record using activities;
  * mail.test.full: complete chatter-enabled record with advanced
    tracking, automatic subscription and automatic email send based on
    templates and tracking;
  * mail.test: chatter-enabled record having an alias. It can be used
    where umbrella record like projects or teams has to be used in
    tests;

 * add MockEmails test class: this class mocks the mail gateway so that
   tests can work on emails without actually sending them. It is taken
   out of TestMail class to clearly separate features from class;
 * improve created data in the various classes and prepare work to
   lessen created data during tests;
 * add helpers on base test class, notably

  * sudoAs: context manager to run a code snippet using a given user;
  * assertNotifications: assert notification content, aka Inbox or email
    notification and their content; may be subject to change depending on
    mail evolution;
  * assertEmails: check content of sent emails;
2017-11-29 10:05:01 +01:00
Christophe Simonis de93645fe3 [MERGE] forward port branch saas-16 up to 82add438f2 2017-11-09 19:16:05 +01:00
Christophe Simonis 90ca872071 [MERGE] forward port branch saas-14 up to d171f282c3 2017-11-09 16:49:41 +01:00
Christophe Simonis 9c634b5b30 [MERGE] forward port branch 10.0 up to a63ecee47a 2017-11-09 15:16:57 +01:00
Christophe Simonis 9342517fcf [MERGE] forward port branch 9.0 up to 35aa2a977f 2017-11-08 17:30:45 +01:00
Thibault Delavallée 53ad585bfc [FIX] mail: ease activities management through documents
This commit improve the daily use of activities by delegating activities
management to the document. Activities are already managed on document
through the UI either in form view or in kanban view.
2017-11-08 10:42:31 +01:00
Thibault Delavallée f8c974cf6e [FIX] mail: speedup tracking values computation when reading messages 2017-11-08 10:00:47 +01:00
Thibault Delavallée 0296f198b2 [IMP] mail: tests: add a new simple base model for testing
Purpose: have simple test models to use in various modules and be
independent from standard models behavior / tweaking.
2017-09-15 15:56:23 +02:00
Thibault Delavallée 927fbe8845 [IMP] mail: make tests less dependent on mail.channel model
Currently almost all mail tests run on mail.channel model. Indeed it is
the only model inheriting from mail.thread and mail.alias when having only
mail installed. However channel model have several specific features and
is not totally a standard mail.thread model. For example notification
recipients are computed a bit differently.

Since 4f9105a4ef mail module has a test
model allowing to perform tests on a very simple mail.thread-like model.
This commit make mail tests use this test model instead of mail.channel
everywhere it is possible. Channel model should be used only when tests
are channel-dependent.
2017-02-21 16:41:14 +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
Thibault Delavallée 6e2a455947 [FIX] mail: restrict write access rights of portal users to their own follower and notification entries 2016-09-14 16:45:01 +02:00
Thibault Delavallée 4f9105a4ef [IMP] mail: handle forwarded emails in mailgateway
If the 'To' of an incoming email is an alias on another model we now consider
this emails as a forward to a new alias. A use case for this is an email on
a task that should be considered as an issue and forwarded to another alias.
2016-09-01 13:25:26 +02:00
Thibault Delavallée 72dfcae2a4 [IMP] mail: improve notification management for customers
Currently it is impossible in Discuss to know whether an email has been sent
to a customer and whether it failed or bounced. A notified partner has an
entry in the needaction m2m table. In this commit we decorate this table to
add fields about the email notification: is an email sent, did it failed, did
it bounce.

This information is kept only for customers. Internal users does not use this
information. Moreover their notification is deleted once the message is read
in the Chatter. This avoids having a notification table that grows quickly.

Chatter now holds a new icon for email details. It allows to know on a thread
status of emails sent to customers.
2016-09-01 12:57:56 +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 57168a9e90 [MERGE] forward port of branch saas-6 up to a669433 2015-09-23 14:34:26 +02:00
Denis Ledoux a3648fd23a [MERGE] forward port of branch 8.0 up to aabbdc7 2015-09-21 16:01:58 +02:00
Adrien Peiffer (ACSONE) 0b4bd7a6d1 [FIX] mail: allow to delete mail alias all employees
It was allowed for all employees to read, create and edit
mail aliases. Only the deletion was prevented.
Nevertheless, giving the possibility to rename a mail alias
is allmost seen as a deletion, as you can rename it to something
that just won't be used anymore. Therefore, we can consider
to give any employees the rights to delete mail aliases.

Besides, not allowing the unlink leads to issues when the
mail alias is associated to a record the user wants to delete.
He was able to create the record, and its mail aliases, but
he could not remove the record, as he was not allowed to remove
the mail alias.
For instance, an HR officer was able to create a job position,
with its mail alias, but couldn't remove the job position he created.

Closes #8466
2015-09-21 14:26:37 +02:00
Jérome Maes 449f254638 [REF] mail : include real time, and replace Timeline features
This commit add instant messaging features in mail module to make it a real team collaboration tool. Lots of these new features will replace Timeleine view (which is not removed in this commit). Many files have been moved, split or created for a better structure.

- My Channels : A user can be member of channel (mail.channel). These are discussion group, but also an aggregate of notification. Setting a channel as document follower, it will receive all the message (of the chatter) in real time, as information stream.

- A new Inbox : this aims to replace the timeline view. The user will see its channels grouped by 'slot', and receive the message in real time. Jump to the form view, invite people, create private discussion group, talk directly to another employee, ... are the main features. Your message can still be starred. The 'Inbox' will only contain your needaction.

- Needaction concept : a needaction is a message calling you to do something. If you follow a document as a person, the posted message will be 'needaction' for you. It can also be a message where you are mention with a '@my_name' (this feature is not added in this commit).

- The chatter doesn't change so much. It still allow you to see the discussion about the document, to star some message, and treat your needaction.

- Chat : the only way to have a minified conversation is from the Inbox Client Action. It allow you to keep an eye on a channel when working on document.

- Compose Message : it is now common to the Inbox, and the chatter. It offers shortcode substitution, attachments management, and optional subtype.

- UI : the chat window has been clean, they have a new look now.

To do so,
- Chatter code have been completely rewrite, independently of timeline view
- Add 'bus' as mail dependency, to insure real time
- A mail.message is broadcasted on the bus channel (db, mail.channel, channel_id), and a channel header on (db, res.partner, partner_id)
- Extracting mail_thread mixin used for Chatter and ChatMailThread (Inbox client action). This uniformize the programming structure with the server side
- Clean CSS style and use LESS instead of CSS
- Define a new messafe format (message_format method in mail_message.py), compatible with fetching and broadcasting
- Apply guideline coding conventions

This commit also break the module im_livechat, since im_chat models don't exists anymore and will be fixed in the next commit.

Thanks to Thibault Delavallee (tde) for the long debates and precious advices, Richard Mathot (rim) for the support, Simon Lejeune (sle) for the client action layout, and the Usability Team (apr, lle, bst yti) for the long testing.

Conflicts:
	addons/mail/models/mail_thread.py
2015-09-01 20:16:09 +02:00
Ajay Javiya 31518bc09b [IMP] base: make group "Technical Features" effective in debug mode only
In method `user_has_groups`, make "Technical Features" effective in debug mode.
Make the group "Employees" inherit "Technical Features".
Make the group "Technical Features" invisible in the user form view.
Remove useless `ir.rule` attached on group "Technical Features".
Fix `test_acl` by avoiding the tricks around the group "Technical Features".
2015-08-28 14:51:09 +02:00
Thibault Delavallée 88b8cd0587 [REF] mail: model update for NewChatter
Main changes :
- mail.notification model is removed. People do not receive notifications
anymore. Instead two ways of following documents exist
  - using a channel; messages will be displayed on the channel itself
  in a near future commit
  - following with its partner; messages will all be considered as
  needaction, using a new m2m table. People should receive less
  needaction messages by following less records by themselves.
There is no more read / unread state anymore. Instead only needaction
messages are considered. Todo (Favorites) messages still exist, and are
stores on a new m2m table instead of using decorated notifciations.
- the main filter for documents is not message_unread anymore, but
message_needaction. A lot of views and filters have been updated
accordingly.
- the vote feature has been removed
2015-08-21 12:11:56 +02:00
Thibault Delavallée c02982b4c4 [REF] mail: mail_channel update
Some features from live_chat have been moved to the mail module :
- channels now have members, replacing followers;
- a decorated m2m is used to link channels and members. It stores the last
seen message on the channel for a specific partner;
- channels do not create menu entries anymore, because the
NewChatter will have its own display and use of channels;
- access rights have been updated accordingly, using members instead of
followers
2015-08-21 12:11:56 +02:00
Thibault Delavallée e6f038a821 [REF] mail: mail_thread: followers update
Followers can now be partners or channels. Partners following a document
will receive needaction, as previously. However people can follow documents
through channels. Members of a channel are able to listen to a stream
of messages using the channel. Those messages do not create needaction
messages. It is therefore possible to follow documents without receiving
too much notifications. For interesting documents subscribing with its
partner will create notification.

message_follower_ids fields is udpated. It is now a many2many to
mail.followers, not to res.partner anymore. A subscription can be either
a partner (partner_id) or a channel (channel_id).

Some access rules have been updated accordingly.
2015-08-21 12:11:56 +02:00
Thibault Delavallée 9f844c570f [REM] mail, calendar: removed dead code (unused method and its
override, unused variables; duplicated code; commented code)
2015-08-06 10:06:18 +02:00
Thibault Delavallée 2c36354ca9 [RENAME] mail, website_mail, website_mail_group, various: mail.group
model has been renamed to mail.channel to prepare the slack modeling.

In future commits the mail.group model will be merged with the channel
model from im_chat. The first move is to rename mail.group into
mail.channel to have a model that will unite both features.
2015-07-09 11:12:50 +02:00
Thibault Delavallée 9cd9aaaa17 [IMP] mail: new internal-only subtype feature.
Starting from now, subtypes can be internal. This means that only employees
(group_user members) can see the messages with this subtype. This feature
replaces and enhances the 'log a note = no subtype = internal only'
feature.

Public and portal users cannot see internal messages. This allows to have
subtypes and a follow mechanism that works for employees and is not
visible for external people.

Its first use will be for Crm Activities, allowing to have custom
subtypes visible only for salesman and not send to the customer.
2015-07-01 12:52:52 +02:00