[REM] mail: subtype dropdown in chatter
The possibility to choose a subtype when logging a note was added with the activities mechanism in CRM. However as the user should not use the chatter but a dedicated wizard in order to do this, the dropdown is removed. The internal subtype mechanism is kept. Only the possibility to log something else than a note through the chatter UI has been removed.
This commit is contained in:
committed by
Thibault Delavallée
parent
83569f9b32
commit
be232e69da
@@ -374,13 +374,6 @@ class MailThread(models.AbstractModel):
|
||||
options = eval(node.get('options', '{}'))
|
||||
is_employee = self.env.user.has_group('base.group_user')
|
||||
options['display_log_button'] = is_employee
|
||||
if is_employee:
|
||||
Subtype = self.env['mail.message.subtype'].sudo()
|
||||
# fetch internal subtypes
|
||||
internal_subtypes = Subtype.search_read([
|
||||
('res_model', 'in', [False, self._name]),
|
||||
('internal', '=', True)], ['name', 'description', 'sequence'])
|
||||
options['internal_subtypes'] = internal_subtypes
|
||||
# emoji list
|
||||
options['emoji_list'] = self.env['mail.shortcode'].search([('shortcode_type', '=', 'image')]).read(['source', 'description', 'substitution'])
|
||||
# save options on the node
|
||||
|
||||
@@ -30,7 +30,6 @@ var ChatterComposer = composer.BasicComposer.extend({
|
||||
display_mode: 'textarea',
|
||||
record_name: false,
|
||||
is_log: false,
|
||||
internal_subtypes: [],
|
||||
});
|
||||
if (this.options.is_log) {
|
||||
this.options.send_text = _t('Log');
|
||||
@@ -56,7 +55,6 @@ var ChatterComposer = composer.BasicComposer.extend({
|
||||
var def = $.Deferred();
|
||||
this._super().then(function (message) {
|
||||
message = _.extend(message, {
|
||||
subtype_id: false,
|
||||
subtype: 'mail.mt_comment',
|
||||
message_type: 'comment',
|
||||
content_subtype: 'html',
|
||||
@@ -65,12 +63,7 @@ var ChatterComposer = composer.BasicComposer.extend({
|
||||
|
||||
// Subtype
|
||||
if (self.options.is_log) {
|
||||
var subtype_id = parseInt(self.$('.o_chatter_composer_subtype_select').val());
|
||||
if (_.indexOf(_.pluck(self.options.internal_subtypes, 'id'), subtype_id) === -1) {
|
||||
message.subtype = 'mail.mt_note';
|
||||
} else {
|
||||
message.subtype_id = subtype_id;
|
||||
}
|
||||
message.subtype = 'mail.mt_note';
|
||||
}
|
||||
|
||||
// Partner_ids
|
||||
@@ -487,7 +480,6 @@ var Chatter = form_common.AbstractField.extend({
|
||||
input_min_height: 50,
|
||||
input_max_height: Number.MAX_VALUE, // no max_height limit for the chatter
|
||||
input_baseline: 14,
|
||||
internal_subtypes: this.options.internal_subtypes,
|
||||
is_log: options && options.is_log,
|
||||
record_name: this.record_name,
|
||||
default_body: old_composer && old_composer.$input.val(),
|
||||
|
||||
@@ -11,19 +11,6 @@
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.o_chatter_composer_subtypes {
|
||||
> label {
|
||||
display: inline-block; // Required for old design compatibility
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.o_chatter_composer_subtype_select {
|
||||
display: inline-block;
|
||||
min-width: 150px;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.o_composer {
|
||||
margin-top: 10px;
|
||||
|
||||
|
||||
@@ -13,16 +13,6 @@
|
||||
Log an internal note which will not be sent to followers, but which can be read
|
||||
by users accessing this document.
|
||||
</span>
|
||||
<!-- Internal subtypes -->
|
||||
<div t-att-class="'o_chatter_composer_subtypes ' +
|
||||
(widget.options.internal_subtypes.length <= 1 ? ' hide' : '')">
|
||||
<label>Activity</label>
|
||||
<select class="o_chatter_composer_subtype_select">
|
||||
<t t-foreach="widget.options.internal_subtypes" t-as="subtype">
|
||||
<option t-att-value="subtype['id']"><t t-esc="subtype['name']"/></option>
|
||||
</t>
|
||||
</select>
|
||||
</div>
|
||||
</t>
|
||||
<!-- New message composer -->
|
||||
<t t-if="!widget.options.is_log">
|
||||
|
||||
Reference in New Issue
Block a user