This allows to have a value for the _set_followers call and be able to have record rules based on followers (eg: note.note).
Set the priority of message_follower_ids fields to -10 to be sure it will be executed before other function fields using these followers (eg: _set_stage_per_user from note.note does a browse which would trigger record rules to read the note)
bzr revid: mat@openerp.com-20140106100010-jl4cuvgvpsw26v28
get_filename method from email lib returns sometimes decoded value, sometimes still encoded.
for instance, get_filename cannot decode iso encoded filename
Recently, decode method has been applied on filename string, to handle iso encoded file.
Sadly, one cannot decode already decoded values.
Therefore, decoding already decoded windows or utf-8 encoded filename with special chars failed.
bzr revid: dle@openerp.com-20140102161149-x268xj7bzvvsit2h
- removed a debug print statement
- now searching all references once instead of each reference one at a time
to lessen the number of queries; as the newest message will be the first
in the search result, it's ok.
bzr revid: tde@openerp.com-20131205093921-h7sits57vqc51c8p
It now accepts <111...222..openerp-res_id-model@mydomain.com> partial matching
only if the target record has messages without message_id, aka <= 6.1 record.
Updated and added tests
bzr revid: tde@openerp.com-20131128133226-ce1qyeswi9n83q8v
- avoid having to browse the record in message_subscribe: refactored message_subscribe
to work on ids without browsing, try to lessen the number of queries to do
- update _set_followers, method of the function field message_follower_ids, to use
message_subscribe and message_unsibscribe
- in create: add author as follower in creation values, not after create, allowing
create access rules based on followers
- updated message_unsubscribe to be the lower method, not calling _set_followers anymore
bzr revid: tde@openerp.com-20131126171752-1irizm7mhv2y1wrn
we have to process attachments as well as attachment_ids in the values generated
by the composer and the optional template.
As this behavior is the same as the one already implemented for message_post, this
feature has been moved into its dedicated method to be called by message_post
or before calling mail_mail.create().
This also allows to have attachments in pure email mass mailing that are attached
to mail.message, not to mail.compose.message model. When unlinking those emails,
the attachments will be also removed, and not lost in the database anymore.
bzr revid: tde@openerp.com-20131126110942-h8p0d9sbjtk0hwlu
- the button is now only displayed for employee users. This is done
by overriding the fields_view_get in mail.thread and adding options
to the widget according to the groups the user belongs to. Indeed
it is currently not possible to set widget options specific to
some groups. Therefore an override of fields view get was
necessary.
- small layout improvements: Log a note -> Log an internal note,
background color of notes updated.
bzr revid: tde@openerp.com-20131125130455-u8517iyr4jgdgoqn
This new code allows faster computation, because it avoids
- searching in a many2many relationship that is very costly in production
databases, because it is replaced by an 'id in [ids]' equivalent leaf
that can be huge.
- browsing in a create/write (should also lessen the number of issues
about read access rights in create)
A new optionnal parameter is given to the method, that are the
modified values. If this is not given (compatibility-mode) the
records are browsed to fetch the value.
bzr revid: tde@openerp.com-20131114113231-oyk16t9i3m3wul6k
When having emails not linked to a notification (mail.notification = False)
the link is generated without any clue about the source record.
However we can try to use model and res_id defined on the mail_mail record
to correctly format a link.
Added support of model and res_id in message_redirect_action. This method
now can redirect based on a message_id, or based on model / res_id.
bzr revid: tde@openerp.com-20131018144924-j4f22hen3lsua7cb
- fixed forgottent import of mail_thread in mass_mailing, to enable bounce and replied tracking
- fixed replied computation in message_route_process, adding the original email in parameters
- fixed form view of campaign, to add edit and dlete now that clicking on it redirects to the waves
- added track field on mail_mail, to avoid creating too mush entries in mail.mail.statistics
- fixed mass_mailign controller
bzr revid: tde@openerp.com-20130916114706-b9zyhp0ha6mr9fzg
Mail statistics are now stored onto a separated object (mail.mail.statistics), allowing to
handle emails separately from statistics (among other removing mail.mail entries while keeping
statistics).
Everything linnked to opened/replied/bounce is not managed by mass_mailing, removed added code
in mail module.
bzr revid: tde@openerp.com-20130913115408-322cyjipdg680as6
alternative mode is computed when browsing the parts, not from
the message content type.
Added tests.
Also added some notification_email_send to none to avoid sending
emails in demo/data/update.
bzr revid: tde@openerp.com-20130823120611-0n4ull3c8gvwug2u
interfering with automatic message_id creation of mail_message
[FIX] mail_thread: fixed issues with private messages through mailgateway
(wrong route checking, variable erasing)
[TEST] mail: added test for the second bug
bzr revid: tde@openerp.com-20130807142418-3h5qxdt3ekosj9x6
Added 2 fields on mail_mail to count read/bounce.
Added bounce alias bounce-mail_id-model-res_id.
Added message_receive_bounce method that try to incremetn message_bounce field.
bzr revid: tde@openerp.com-20130806151143-7dw6xlj8n7mh0nqe
{'is_editable': True/False, 'is_uid': True/False}
-- where is_editable will be True if uid is in technical group
-- where is_uid will be True if uid is in partner.user_ids.
bzr revid: psa@tinyerp.com-20130712133920-96l6axns7yynyz9e
Previous implementation did a search on mail.followers with subtype_ids=False, leading
to a very bad computation time. This search is now avoided.
bzr revid: tde@openerp.com-20130613082029-lmd63s3mqwxasy4j
Purpose:
- mail is now focused on messaging; partner document is now a classic document, without specific behavior; removed the concept of 'my followers' from mail;
- hr adds social features to mail: employee profile is used to display internal messages; employees can follow other employees, comment and react on their profile messages;
- display suggestion of Groups and Employees to follow in the Inbox, using a new widget. The purpose is to promote social interactions between employees and to improve the visibility of groups;
mail:
- add suggestions.Group widget that allows to display a list of suggested groups to follow; this widget is displayed in the Inbox;
- display 'Partner profile of' or 'News from' when reading messages from a partner profile / employee profile in the Inbox;
- 'Compose a new message or Write to my followers' is not present anymore when hr is not installed, because this social aspect comes with HR;
- mail_thread: add a search function on message_is_follower;
- mail_group: implement suggested groups behavior;
- res_partner: removed specific code changing message_post with type='email' to a private discussion between author and destination partner; partner document behaves like a classic document;
- res_users: add 'display_groups_suggestions' field that controls the display of suggested groups to follow;
- res_users: writing on a res.users object is considered as a private discussion; when Hr is not installed, only aliases should be able to post on a user;
hr_employee:
- when creating an employee, post a message on its profile and push it to every employees of the same company;
- add follow/unfollow and message and follower count on employee kanban view;
- implement suggested employee behavior;
- HR improves the basic Inbox by adding the 'Compose a new message or Write to my followers';
- allow to post on an employee profile when having read access right if the user that posts is an employee;
HR:
- add suggestions.Employee widget that allows to display a list of suggested employees to follow; this widget is displayed in the Inbox;
- res_users: add 'display_employees_suggestions' field that controls the display of suggested employees to follow;
- res_users: do not welcome new users anymore, welcome new employees instead
- res_users: incoming emails are still considered as private messages (using aliases); however messages posted on user profile are redirected to the related employee profiles (used for 'Write to my followers')
bzr revid: tde@openerp.com-20130612121258-j38do5opsot2ur7c
mail.compose.message wizard and messaage_process now check that the active model
has message_post defined. Otherwise using thread_model context key that is better
managed in message_post, it is possible to use mail_thread.message_post() with a
thread_model and thread_id that should not allow message_post otherwise.
Hint: look for backport into 7.0
bzr revid: tde@openerp.com-20130606123230-d7ql14yydzfrlc7h
Check only aliases that effectively create new records (not aliases used for updating).
When having several possible aliases, do not display any alias, because we do not have
any information about the correct alias to display.
bzr revid: tde@openerp.com-20130530124128-w7lz1jsrspyu38dv
[FIX] mail, project, project_issue, crm_lead: fixed 'XX Created' subtype not triggered because of condition
based on state=new and not state=draft.
For tasks, issues and leads, no generic 'Document created' message is posted anymore
because of the 'XX Created' message with subtype automatically logged.
Generic creation message is logged before automatic subscription to enable
message pushing to responsibles.
bzr revid: mat@openerp.com-20130529143022-wy76srwb2nwkspe3
based on state=new and not state=draft.
For tasks, issues and leads, no generic 'Document created' message is posted anymore
because of the 'XX Created' message with subtype automatically logged.
Generic creation message is logged before automatic subscription to enable
message pushing to responsibles.
bzr revid: tde@openerp.com-20130529131458-9709ffrsy479hwy3
[FIX] mail_message, mail, project, task, issue: it is now possible to have model-specific access rule checking for mail.message related acces right / rules. Task and issue allow to create mail.message when the user has a read access on the related document, not only when having write access.
bzr revid: tde@openerp.com-20130528144447-3ivcom6r9x7q949b
The parent record is the record that holds the alias. It is different
from the record updated or created using the alias. For example
projects have aliases whose parent is the given projet, and that creates
new task inside the project.
Updated alias creation and management accordingly.
This ownership concept is used to compute the 'followers' contact
settings of aliases.
bzr revid: tde@openerp.com-20130516164207-1zr0q6abw6a34ndf
Now handles private aliases (alias_contact as partners or followers).
message_route now works in 2 steps :
1/ finding all possible routes, as before
2/ checks and filtrates those routes, by finding the most
relevant message author and using it to check alias contact settings.
Also refactored the various partner finding method in one method
that checks in res.partner, for: partners, partners that are users,
partners that follow a given document.
bzr revid: tde@openerp.com-20130416132813-zcm1r5kx0dwrfeic
The way attachments are linked to the document has been cleaned. Posting method message_post may receives 2 arguments:
- attachment_ids: those linked to the wizard model (mail.compose.message) are linked to the document (res_model, res_id)
- attachments: the tuples are used to create new attachments linked to the document
The wizard does not set the res_model and res_id of attachments anymore, delegating this job to message_post.
The mail.message and mail.compose.message now use their respective attachment_ids field when possible. This is done instead of reading/creating new attachments based on the attachments tuple each time a mail.compose.message is processed. Email templates now also use attachment_ids, in particular when generating emails, instead of using the attachments tuple. Only reports are still generated on the fly and put into attachments instead of attachment_ids.
A cron job has been added to unlink 'lost' attachments. Those are attachments:
- linked to 'mail.compose.message'
- with res_id=0 (due Chatter used in minimal mode or reports generated by templates before the wizard has an ID)
- with no activity for more than one day (create_date and write_date)
bzr revid: tde@openerp.com-20130411112033-mqph9vjlcjkoolfs
Document created text was not translatable
Subtype was fetched without context, therefore not translated
Removed odd override of _t introduced in mail_followers at revision 7885
bzr revid: tde@openerp.com-20130408092447-3ri41v6xluuj0wha
As suggested by tde in his comment
>> **What's the purpose of defining a new 'check_access_right' ? Limiting to 'group_no_one' does not seems a viable solution. Instead, access rights on mail.followers entries should be correctly written (please check it is the case). I think having an asynchronous call just to check access rights is not necessary. In debug mode, always display the button.**
bzr revid: psa@tinyerp.com-20130404084724-meqsx35jdvk56z2c
1) Edit Subscriptions of -> Edit Subscription (without 's') of
2) Instead of defining a new 'apply_edited_subtype', you can use 'message_subscribe' that has an optional 'subtype_ids' parameter that already allows to manage subtypes of a subscription.
3) In _get_subscription_data: do not use context when it is not necessary. Please add a parameter user_id=None that will be used instead of uid to find user_pid.
4) Instead of defining a new 'on_apply_subtype', can't you reuse 'do_update_subscription' with maybe some update to handle the classic use / edit widget ?
The above changes has been done.
bzr revid: psa@tinyerp.com-20130404070723-5v1v35fte6vl2b2j
Before trying to find possible routes, check that the incoming email's
message_id is not already present in mail.message table.
If it is the case, return False.
Parsing of the message has been moved before routing, to avoid looking
for routes for emails we will discard.
Tests have been added and updated.
bzr revid: tde@openerp.com-20130322124809-ven2p5kxpqfjqxb5
The mailgateway tries to find a partner that is also an user with the email_from.
If none is found, it takes the first partner with matching email.
In message_post, it tries to find the author based on the document's followers.
Indeed it is very likely that an answer comes from a follower of a document.
The whole process is not done inside the mailgateway because document
and followers related stuff belong to message_post, not to the mail gateway.
Tests have been added in mail.
bzr revid: tde@openerp.com-20130321120451-qk524qayq28sw3th