2012-08-10 13:05:42 +00:00
openerp _mail _followers = function ( session , mail ) {
var _t = session . web . _t ,
_lt = session . web . _lt ;
var mail _followers = session . mail _followers = { } ;
/ * *
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
2012-08-15 23:26:49 +00:00
* mail _followers Widget
2012-08-10 13:05:42 +00:00
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
*
2012-09-04 13:36:48 +00:00
* This widget handles the display of a list of records as a vertical
2012-08-15 23:26:49 +00:00
* list , with an image on the left . The widget itself is a floatting
* right - sided box .
* This widget is mainly used to display the followers of records
* in OpenChatter .
2012-08-10 13:05:42 +00:00
* /
2012-08-15 23:26:49 +00:00
/* Add the widget to registry */
2012-08-10 13:05:42 +00:00
session . web . form . widgets . add ( 'mail_followers' , 'openerp.mail_followers.Followers' ) ;
mail _followers . Followers = session . web . form . AbstractField . extend ( {
template : 'mail.followers' ,
2012-08-15 23:26:49 +00:00
init : function ( ) {
2012-08-10 13:05:42 +00:00
this . _super . apply ( this , arguments ) ;
2012-10-24 15:20:43 +00:00
this . image = this . node . attrs . image || 'image_small' ;
this . comment = this . node . attrs . help || false ;
2012-12-20 15:29:06 +00:00
this . displayed _limit = this . node . attrs . displayed _nb || 10 ;
this . displayed _nb = this . displayed _limit ;
2012-08-13 16:00:27 +00:00
this . ds _model = new session . web . DataSetSearch ( this , this . view . model ) ;
2012-10-18 09:13:27 +00:00
this . ds _users = new session . web . DataSetSearch ( this , 'res.users' ) ;
2012-11-08 15:33:27 +00:00
this . value = [ ] ;
2012-12-20 15:29:06 +00:00
this . followers = [ ] ;
2012-12-21 10:26:49 +00:00
this . view _is _editable = this . _ _parentedParent . is _action _enabled ( 'edit' ) ;
2012-08-10 13:05:42 +00:00
} ,
2012-08-15 23:26:49 +00:00
2012-08-10 13:05:42 +00:00
start : function ( ) {
2012-09-12 13:36:27 +00:00
// use actual_mode property on view to know if the view is in create mode anymore
2012-11-20 16:24:34 +00:00
this . view . on ( "change:actual_mode" , this , this . on _check _visibility _mode ) ;
this . on _check _visibility _mode ( ) ;
2012-08-10 13:05:42 +00:00
this . reinit ( ) ;
2012-09-13 16:03:29 +00:00
this . bind _events ( ) ;
2012-10-19 12:06:48 +00:00
this . _super ( ) ;
2012-08-10 13:05:42 +00:00
} ,
2012-08-15 23:26:49 +00:00
2012-11-20 16:24:34 +00:00
on _check _visibility _mode : function ( ) {
this . set ( { "force_invisible" : this . view . get ( "actual_mode" ) == "create" } ) ;
} ,
2012-11-08 15:33:27 +00:00
set _value : function ( _value ) {
this . value = _value ;
this . _super ( _value ) ;
} ,
2012-08-10 13:05:42 +00:00
reinit : function ( ) {
2012-09-18 09:12:12 +00:00
this . message _is _follower == undefined ;
this . display _buttons ( ) ;
2012-08-10 13:05:42 +00:00
} ,
2012-08-15 23:26:49 +00:00
2012-09-12 13:36:27 +00:00
bind _events : function ( ) {
var self = this ;
2012-10-18 09:13:27 +00:00
// event: click on '(Un)Follow' button, that toggles the follow for uid
this . $ ( '.oe_follower' ) . on ( 'click' , function ( event ) {
2012-10-16 11:17:53 +00:00
if ( $ ( this ) . hasClass ( 'oe_notfollow' ) )
self . do _follow ( ) ;
else
self . do _unfollow ( ) ;
} ) ;
2012-10-18 09:13:27 +00:00
// event: click on a subtype, that (un)subscribe for this subtype
2014-02-24 09:49:51 +00:00
this . $el . on ( 'click' , '.oe_subtype_list input' , function ( event ) {
2014-02-24 10:52:49 +00:00
self . do _update _subscription ( event ) ;
2014-02-24 11:25:04 +00:00
var $list = self . $ ( '.oe_subtype_list' ) ;
2014-02-25 04:51:42 +00:00
if ( ! $list . hasClass ( 'open' ) ) {
2014-02-24 11:25:04 +00:00
$list . addClass ( 'open' ) ;
2014-02-25 04:51:42 +00:00
}
if ( self . $ ( '.oe_subtype_list ul' ) [ 0 ] . children . length < 1 ) {
$list . removeClass ( 'open' ) ;
}
2014-02-24 09:49:51 +00:00
event . stopPropagation ( ) ;
} ) ;
2012-10-18 09:13:27 +00:00
// event: click on 'invite' button, that opens the invite wizard
2012-12-20 14:09:46 +00:00
this . $ ( '.oe_invite' ) . on ( 'click' , self . on _invite _follower ) ;
2013-06-26 10:47:22 +00:00
// event: click on 'edit_subtype(pencil)' button to edit subscription
2013-03-05 12:54:42 +00:00
this . $el . on ( 'click' , '.oe_edit_subtype' , self . on _edit _subtype ) ;
2012-12-20 14:09:46 +00:00
this . $el . on ( 'click' , '.oe_remove_follower' , self . on _remove _follower ) ;
2014-10-02 15:34:59 +00:00
this . $el . on ( 'click' , '.oe_show_more' , self . on _show _more _followers ) ;
this . $el . on ( 'click' , 'a[data-partner]' , self . on _follower _clicked ) ;
2012-12-20 14:09:46 +00:00
} ,
2013-03-14 10:29:49 +00:00
on _edit _subtype : function ( event ) {
2013-03-05 12:54:42 +00:00
var self = this ;
2013-06-26 10:47:22 +00:00
var $currentTarget = $ ( event . currentTarget ) ;
var user _pid = $currentTarget . data ( 'id' ) ;
2013-05-30 04:40:37 +00:00
$ ( 'div.oe_edit_actions' ) . remove ( ) ;
2014-04-10 15:50:22 +00:00
self . $dialog = new session . web . Dialog ( this , {
2014-04-11 12:28:40 +00:00
size : 'small' ,
2013-06-26 10:47:22 +00:00
title : _t ( 'Edit Subscription of ' ) + $currentTarget . siblings ( 'a' ) . text ( ) ,
2013-03-14 10:29:49 +00:00
buttons : [
2013-03-15 08:52:45 +00:00
{ text : _t ( "Apply" ) , click : function ( ) {
2013-06-05 13:10:31 +00:00
self . do _update _subscription ( event , user _pid ) ;
2014-04-10 15:50:22 +00:00
this . parents ( '.modal' ) . modal ( 'hide' ) ;
2013-03-15 08:52:45 +00:00
} } ,
2014-04-10 15:50:22 +00:00
{ text : _t ( "Cancel" ) , click : function ( ) { this . parents ( '.modal' ) . modal ( 'hide' ) ; } }
2013-03-14 10:29:49 +00:00
] ,
2014-04-10 15:50:22 +00:00
} , "<div class='oe_edit_actions'>" ) . open ( ) ;
2013-06-26 10:47:22 +00:00
return self . fetch _subtypes ( user _pid ) ;
2013-03-05 12:54:42 +00:00
} ,
2012-12-20 14:09:46 +00:00
on _invite _follower : function ( event ) {
var self = this ;
var action = {
type : 'ir.actions.act_window' ,
res _model : 'mail.wizard.invite' ,
view _mode : 'form' ,
view _type : 'form' ,
views : [ [ false , 'form' ] ] ,
target : 'new' ,
context : {
'default_res_model' : this . view . dataset . model ,
'default_res_id' : this . view . datarecord . id ,
} ,
}
this . do _action ( action , {
on _close : function ( ) {
self . read _value ( ) ;
} ,
2012-09-12 13:36:27 +00:00
} ) ;
} ,
2012-12-20 15:29:06 +00:00
on _show _more _followers : function ( event ) {
this . displayed _nb += this . displayed _limit ;
this . display _followers ( false ) ;
} ,
2012-12-20 14:09:46 +00:00
on _remove _follower : function ( event ) {
var partner _id = $ ( event . target ) . data ( 'id' ) ;
2013-02-14 15:09:49 +00:00
var name = $ ( event . target ) . parent ( ) . find ( "a" ) . html ( ) ;
if ( confirm ( _ . str . sprintf ( _t ( "Warning! \n %s won't be notified of any email or discussion on this document. Do you really want to remove him from the followers ?" ) , name ) ) ) {
var context = new session . web . CompoundContext ( this . build _context ( ) , { } ) ;
return this . ds _model . call ( 'message_unsubscribe' , [ [ this . view . datarecord . id ] , [ partner _id ] , context ] )
. then ( this . proxy ( 'read_value' ) ) ;
}
2012-12-20 14:09:46 +00:00
} ,
2014-10-02 15:34:59 +00:00
on _follower _clicked : function ( event ) {
event . preventDefault ( ) ;
var partner _id = $ ( event . target ) . data ( 'partner' ) ;
var state = {
'model' : 'res.partner' ,
'id' : partner _id ,
'title' : this . record _name
} ;
session . webclient . action _manager . do _push _state ( state ) ;
var action = {
type : 'ir.actions.act_window' ,
view _type : 'form' ,
view _mode : 'form' ,
res _model : 'res.partner' ,
views : [ [ false , 'form' ] ] ,
res _id : partner _id ,
}
this . do _action ( action ) ;
} ,
2012-10-18 09:13:27 +00:00
read _value : function ( ) {
2012-09-12 13:36:27 +00:00
var self = this ;
2012-12-20 15:29:06 +00:00
this . displayed _nb = this . displayed _limit ;
2012-11-08 14:22:30 +00:00
return this . ds _model . read _ids ( [ this . view . datarecord . id ] , [ 'message_follower_ids' ] ) . then ( function ( results ) {
2012-11-08 15:33:27 +00:00
self . value = results [ 0 ] . message _follower _ids ;
self . render _value ( ) ;
2012-09-20 11:49:09 +00:00
} ) ;
2012-08-10 13:05:42 +00:00
} ,
2012-08-15 23:26:49 +00:00
2012-10-18 09:13:27 +00:00
render _value : function ( ) {
2012-09-24 09:56:16 +00:00
this . reinit ( ) ;
2012-11-08 15:33:27 +00:00
return this . fetch _followers ( this . value ) ;
2012-08-10 13:05:42 +00:00
} ,
2012-08-15 23:26:49 +00:00
2012-09-25 08:58:09 +00:00
fetch _followers : function ( value _ ) {
2013-10-17 13:16:34 +00:00
this . value = value _ || [ ] ;
2013-07-17 12:48:42 +00:00
return this . ds _model . call ( 'read_followers_data' , [ this . value ] )
. then ( this . proxy ( 'display_followers' ) , this . proxy ( 'fetch_generic' ) )
. then ( this . proxy ( 'display_buttons' ) )
. then ( this . proxy ( 'fetch_subtypes' ) ) ;
2012-09-17 15:01:29 +00:00
} ,
2012-10-18 09:13:27 +00:00
/ * * R e a d o n r e s . p a r t n e r f a i l e d : f a l l b a c k o n a g e n e r i c c a s e
- fetch current user partner _id ( call because no other smart solution currently ) FIXME
- then display a generic message about followers * /
fetch _generic : function ( error , event ) {
var self = this ;
2012-09-17 15:01:29 +00:00
event . preventDefault ( ) ;
2014-07-06 14:44:26 +00:00
return this . ds _users . call ( 'read' , [ [ this . session . uid ] , [ 'partner_id' ] ] ) . then ( function ( results ) {
var pid = results [ 0 ] [ 'partner_id' ] [ 0 ] ;
2012-11-08 15:33:27 +00:00
self . message _is _follower = ( _ . indexOf ( self . value , pid ) != - 1 ) ;
2012-11-08 14:22:30 +00:00
} ) . then ( self . proxy ( 'display_generic' ) ) ;
2012-10-18 09:13:27 +00:00
} ,
2013-07-23 09:55:09 +00:00
2012-10-26 09:58:21 +00:00
_format _followers : function ( count ) {
var str = '' ;
if ( count <= 0 ) {
str = _t ( 'No followers' ) ;
} else if ( count === 1 ) {
str = _t ( 'One follower' ) ;
} else {
str = '' + count + ' ' + _t ( 'followers' ) ;
}
return str ;
} ,
2013-07-23 09:55:09 +00:00
2012-10-18 09:13:27 +00:00
/* Display generic info about follower, for people not having access to res_partner */
display _generic : function ( ) {
var self = this ;
2012-10-24 15:20:43 +00:00
var node _user _list = this . $ ( '.oe_follower_list' ) . empty ( ) ;
2012-11-08 15:33:27 +00:00
this . $ ( '.oe_follower_title' ) . html ( this . _format _followers ( this . value . length ) ) ;
2012-08-10 13:05:42 +00:00
} ,
2012-08-15 23:26:49 +00:00
2012-10-16 11:17:53 +00:00
/** Display the followers */
2012-08-16 07:26:42 +00:00
display _followers : function ( records ) {
2012-08-10 13:05:42 +00:00
var self = this ;
2013-07-15 08:49:07 +00:00
this . message _is _follower = false ;
2012-12-20 15:29:06 +00:00
this . followers = records || this . followers ;
2012-10-18 09:13:27 +00:00
// clean and display title
2012-10-24 15:20:43 +00:00
var node _user _list = this . $ ( '.oe_follower_list' ) . empty ( ) ;
2012-12-20 15:29:06 +00:00
this . $ ( '.oe_follower_title' ) . html ( this . _format _followers ( this . followers . length ) ) ;
2014-02-07 08:49:46 +00:00
self . message _is _follower = _ . indexOf ( this . followers . map ( function ( rec ) { return rec [ 2 ] [ 'is_uid' ] } ) , true ) != - 1 ;
2012-10-18 09:13:27 +00:00
// truncate number of displayed followers
2012-12-20 15:29:06 +00:00
var truncated = this . followers . slice ( 0 , this . displayed _nb ) ;
2012-10-18 09:13:27 +00:00
_ ( truncated ) . each ( function ( record ) {
2013-07-23 09:55:09 +00:00
partner = {
'id' : record [ 0 ] ,
'name' : record [ 1 ] ,
'is_uid' : record [ 2 ] [ 'is_uid' ] ,
'is_editable' : record [ 2 ] [ 'is_editable' ] ,
'avatar_url' : mail . ChatterUtils . get _image ( self . session , 'res.partner' , 'image_small' , record [ 0 ] ) ,
}
$ ( session . web . qweb . render ( 'mail.followers.partner' , { 'record' : partner , 'widget' : self } ) ) . appendTo ( node _user _list ) ;
2013-07-12 13:39:20 +00:00
// On mouse-enter it will show the edit_subtype pencil.
2013-07-23 09:55:09 +00:00
if ( partner . is _editable ) {
self . $ ( '.oe_follower_list' ) . on ( 'mouseenter mouseleave' , function ( e ) {
self . $ ( '.oe_edit_subtype' ) . toggleClass ( 'oe_hidden' , e . type == 'mouseleave' ) ;
self . $ ( '.oe_follower_list' ) . find ( '.oe_partner' ) . toggleClass ( 'oe_partner_name' , e . type == 'mouseenter' ) ;
2013-07-17 12:48:42 +00:00
} ) ;
}
2012-10-18 09:13:27 +00:00
} ) ;
2012-10-29 11:21:17 +00:00
// FVA note: be sure it is correctly translated
2012-12-20 15:29:06 +00:00
if ( truncated . length < this . followers . length ) {
$ ( session . web . qweb . render ( 'mail.followers.show_more' , { 'number' : ( this . followers . length - truncated . length ) } ) ) . appendTo ( node _user _list ) ;
2012-09-26 07:17:09 +00:00
}
2012-09-18 09:12:12 +00:00
} ,
display _buttons : function ( ) {
2012-09-24 09:56:16 +00:00
if ( this . message _is _follower ) {
2012-09-26 07:17:09 +00:00
this . $ ( 'button.oe_follower' ) . removeClass ( 'oe_notfollow' ) . addClass ( 'oe_following' ) ;
2012-09-20 11:49:09 +00:00
}
2012-08-10 13:05:42 +00:00
else {
2012-09-26 07:17:09 +00:00
this . $ ( 'button.oe_follower' ) . removeClass ( 'oe_following' ) . addClass ( 'oe_notfollow' ) ;
2012-09-20 11:49:09 +00:00
}
2012-10-15 12:03:31 +00:00
2012-09-21 09:50:37 +00:00
if ( this . view . is _action _enabled ( 'edit' ) )
2012-09-26 07:17:09 +00:00
this . $ ( 'span.oe_mail_invite_wrapper' ) . hide ( ) ;
2012-09-21 09:50:37 +00:00
else
2012-09-26 07:17:09 +00:00
this . $ ( 'span.oe_mail_invite_wrapper' ) . show ( ) ;
2012-08-28 07:19:06 +00:00
} ,
2012-09-20 11:49:09 +00:00
2012-10-18 09:13:27 +00:00
/** Fetch subtypes, only if current user is follower */
2013-06-05 13:10:31 +00:00
fetch _subtypes : function ( user _pid ) {
2013-02-15 11:19:26 +00:00
var self = this ;
2013-07-23 09:55:09 +00:00
var dialog = false ;
2013-06-05 13:10:31 +00:00
if ( user _pid ) {
2013-07-23 09:55:09 +00:00
dialog = true ;
2013-03-21 12:40:36 +00:00
} else {
2014-02-20 10:29:58 +00:00
var subtype _list _ul = this . $ ( '.oe_subtype_list ul' ) . empty ( ) ;
2014-03-31 07:31:00 +00:00
if ( ! this . message _is _follower ) {
this . $ ( '.oe_subtype_list > .dropdown-toggle' ) . attr ( 'disabled' , true ) ;
return ;
}
else {
this . $ ( '.oe_subtype_list > .dropdown-toggle' ) . attr ( 'disabled' , false ) ;
}
2013-03-21 12:40:36 +00:00
}
2013-02-15 11:19:26 +00:00
var id = this . view . datarecord . id ;
2013-06-05 13:10:31 +00:00
this . ds _model . call ( 'message_get_subscription_data' , [ [ id ] , user _pid , new session . web . CompoundContext ( this . build _context ( ) , { } ) ] )
2013-07-23 09:55:09 +00:00
. then ( function ( data ) { self . display _subtypes ( data , id , dialog ) ; } ) ;
2012-10-18 09:13:27 +00:00
} ,
/** Display subtypes: {'name': default, followed} */
2013-07-23 09:55:09 +00:00
display _subtypes : function ( data , id , dialog ) {
2012-09-24 09:56:16 +00:00
var self = this ;
2013-07-23 09:55:09 +00:00
if ( dialog ) {
2014-04-10 15:50:22 +00:00
var $list = self . $dialog . $el ;
2013-07-23 09:55:09 +00:00
}
else {
2014-02-20 10:29:58 +00:00
var $list = this . $ ( '.oe_subtype_list ul' ) ;
2013-07-23 09:55:09 +00:00
}
2013-11-26 12:46:30 +00:00
var records = data [ id ] . message _subtype _data ;
2013-06-12 11:45:38 +00:00
this . records _length = $ . map ( records , function ( value , index ) { return index ; } ) . length ;
if ( this . records _length > 1 ) { self . display _followers ( ) ; }
2014-02-19 10:52:46 +00:00
var old _model = '' ;
2013-01-28 15:05:18 +00:00
_ ( records ) . each ( function ( record , record _name ) {
2014-02-19 10:52:46 +00:00
if ( old _model != record . parent _model ) {
if ( old _model != '' ) {
var index = $ ( $list ) . find ( '.oe_subtype' ) . length ;
$ ( $ ( $list ) . find ( '.oe_subtype' ) [ index - 1 ] ) . addClass ( 'subtype-border' ) ;
}
old _model = record . parent _model ;
}
2013-01-28 15:05:18 +00:00
record . name = record _name ;
record . followed = record . followed || undefined ;
2014-02-24 10:07:58 +00:00
$ ( session . web . qweb . render ( 'mail.followers.subtype' , { 'record' : record , 'dialog' : dialog } ) ) . appendTo ( $list ) ;
2013-01-28 15:05:18 +00:00
} ) ;
2012-08-23 06:02:16 +00:00
} ,
2012-09-24 09:56:16 +00:00
2012-08-10 13:05:42 +00:00
do _follow : function ( ) {
2012-12-20 13:24:34 +00:00
var context = new session . web . CompoundContext ( this . build _context ( ) , { } ) ;
2014-03-31 07:31:00 +00:00
this . $ ( '.oe_subtype_list > .dropdown-toggle' ) . attr ( 'disabled' , false ) ;
2013-06-05 13:10:31 +00:00
this . ds _model . call ( 'message_subscribe_users' , [ [ this . view . datarecord . id ] , [ this . session . uid ] , undefined , context ] )
2012-12-20 13:24:34 +00:00
. then ( this . proxy ( 'read_value' ) ) ;
_ . each ( this . $ ( '.oe_subtype_list input' ) , function ( record ) {
2012-10-18 09:13:27 +00:00
$ ( record ) . attr ( 'checked' , 'checked' ) ;
2012-09-25 08:58:09 +00:00
} ) ;
2012-08-22 06:27:22 +00:00
} ,
2012-09-24 09:56:16 +00:00
2013-06-05 13:10:31 +00:00
do _unfollow : function ( user _pid ) {
2014-02-25 04:51:42 +00:00
var self = this ;
2013-02-14 15:09:49 +00:00
if ( confirm ( _t ( "Warning! \nYou won't be notified of any email or discussion on this document. Do you really want to unfollow this document ?" ) ) ) {
_ ( this . $ ( '.oe_msg_subtype_check' ) ) . each ( function ( record ) {
$ ( record ) . attr ( 'checked' , false ) ;
} ) ;
2013-06-12 05:26:45 +00:00
var action _unsubscribe = 'message_unsubscribe_users' ;
2014-03-31 07:31:00 +00:00
this . $ ( '.oe_subtype_list > .dropdown-toggle' ) . attr ( 'disabled' , true ) ;
2013-06-05 13:10:31 +00:00
var follower _ids = [ this . session . uid ] ;
if ( user _pid ) {
2013-06-12 05:26:45 +00:00
action _unsubscribe = 'message_unsubscribe' ;
2013-06-05 13:10:31 +00:00
follower _ids = [ user _pid ] ;
}
2013-02-14 15:09:49 +00:00
var context = new session . web . CompoundContext ( this . build _context ( ) , { } ) ;
2013-06-12 05:26:45 +00:00
return this . ds _model . call ( action _unsubscribe , [ [ this . view . datarecord . id ] , follower _ids , context ] )
2013-06-05 13:10:31 +00:00
. then ( this . proxy ( 'read_value' ) ) ;
2013-02-14 15:09:49 +00:00
}
return false ;
2012-08-10 13:05:42 +00:00
} ,
2012-09-20 11:49:09 +00:00
2013-06-05 13:10:31 +00:00
do _update _subscription : function ( event , user _pid ) {
2012-09-20 11:49:09 +00:00
var self = this ;
2012-09-24 09:56:16 +00:00
2013-06-12 05:26:45 +00:00
var action _subscribe = 'message_subscribe_users' ;
2013-06-05 13:10:31 +00:00
var follower _ids = [ this . session . uid ] ;
var oe _action = this . $ ( '.oe_actions input[type="checkbox"]' ) ;
if ( user _pid ) {
2013-06-12 05:26:45 +00:00
action _subscribe = 'message_subscribe' ;
2013-06-05 13:10:31 +00:00
follower _ids = [ user _pid ] ;
oe _action = $ ( '.oe_edit_actions input[type="checkbox"]' ) ;
}
2012-09-20 11:49:09 +00:00
var checklist = new Array ( ) ;
2013-06-05 13:10:31 +00:00
_ ( oe _action ) . each ( function ( record ) {
2013-04-05 13:44:25 +00:00
if ( $ ( record ) . is ( ':checked' ) ) {
checklist . push ( parseInt ( $ ( record ) . data ( 'id' ) ) ) ;
}
} ) ;
2013-04-09 04:39:32 +00:00
2012-12-20 13:24:34 +00:00
if ( ! checklist . length ) {
2013-06-05 13:10:31 +00:00
if ( ! this . do _unfollow ( user _pid ) ) {
[MERGE] Chatter and CRM: usability fixes and improvements
Chatter:
- now displays the 'To' of messages, aka notified people,
- now allows to Send a message or to Log a note, that is a message not pushed to anyone; however users that see the document still see the log message,
- fixed suggested recipient behavior: canceling the partner creation popup now correctly avoids creating a partner,
- moved 'Advanced wizard' button on top-right,
- unfollowing or removing someone from followers now displays a warning,
CRM, Recruitment, Issues:
- better management of customers/applicants: Chatter suggests to notify and add as follower the customer, or to create a partner based on the email_from,
CRM, Recruitment, Tasks, Issues:
- changing the user_id (salesman, responsible) still adds the related partner as follower; but now an unread notification is pushed, with the first email or first message if no email,
- updated and added if missing message_summary in kanban views, now displayed only when having unread messages, and the related number, to be more visible,
CRM:
- crm_partner_assign: fixed forward-to-partner wizard,
- crm_partner_assign: geo localization now also sets salesteam along with salesman,
- crm: fixed opportunity email_template,
- crm: removed 'Send mail' button, as the functionality should be covered by Chatter (but the code of the action is left untouched to avoid errors),
Mail:
- merged message_post and message_post_user_api because there was an opportunity to avoid doing similar things in two different methods,
- fixed email_from of incoming email not always stored,
- followers: authors of discussion messages are now added as followers, this is not only limited to incoming emails,
- followers: recipients of emails coming through the mail gateway are not automatically added as followers of the target documents,
- followers: slightly updated _notify, to be able to notify a partner of a specific message; the notification process is therefore accessible outside of the mail_message.create() process
bzr revid: tde@openerp.com-20130301101122-l18mr6hb0j5k4atv
2013-03-01 10:11:22 +00:00
$ ( event . target ) . attr ( "checked" , "checked" ) ;
2014-02-25 04:51:42 +00:00
} else {
self . $ ( '.oe_subtype_list ul' ) . empty ( ) ;
2013-02-14 15:09:49 +00:00
}
2012-12-20 13:24:34 +00:00
} else {
var context = new session . web . CompoundContext ( this . build _context ( ) , { } ) ;
2014-02-24 10:07:58 +00:00
return this . ds _model . call ( action _subscribe , [ [ this . view . datarecord . id ] , follower _ids , checklist , context ] )
. then ( this . proxy ( 'read_value' ) ) ;
2012-12-20 13:24:34 +00:00
}
2012-09-20 11:49:09 +00:00
} ,
2012-08-10 13:05:42 +00:00
} ) ;
2012-10-17 14:56:39 +00:00
} ;