Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5431 Lượt xem

In chatter "New message" is rarely used by our users. The user opens form where a chatter is but has to click "Log internal note" every time (because "New message" is rarely used).

How to make so that when user opens form (which contains chatter) the "Log internal note" from the chatter is opened?

Odoo version 10. If that can be done through UI it is preferred but any solution is ok. Thank you. :)

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I tried 


odoo.define('x_note.note_click', function(require) {
    "use strict";
    var core = require('web.core');
    var Chatter = require('mail.Chatter');
    var MailThread = core.form_widget_registry.get('mail_thread');
    var NewChatter = MailThread.include({
init: function() {
this._super.apply(this, arguments);
var self = this;
self.trigger('on_open_composer_log_note');
//on_open_composer_log_note(); tried this and it gives error
},
start: function() {
this._super.apply(this, arguments);
var self = this;
self.trigger('on_open_composer_log_note');
},
});
});

But it didn't work. Where is my mistake?

Ảnh đại diện
Huỷ bỏ
Tác giả

This worked odoo.define('x_note.note_click', function(require) {

"use strict";

var core = require('web.core');

var Chatter = require('mail.Chatter');

var MailThread = core.form_widget_registry.get('mail_thread');

var NewChatter = MailThread.include({

start: function() {

this._super.apply(this, arguments);

this.$(".o_chatter_button_log_note").trigger('click');

},

});

});

Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 11 17
6641
2
thg 2 25
7297
1
thg 9 20
7160
1
thg 11 19
4978
0
thg 5 19
3344