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

Hello,

does anyone knew whow i can disable the creation message of an object? I just want to disable the createion message, not all messages.


Regards

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

Here is the answer:

class my_class(models.Model):

     _inherit = 'my.class'

     @api.model

     def create(self, data):

         return super(my_class, self.with_context(tracking_disable=True)).create(data)

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

The full list of undocumented features for mail message, controllable with context:.

    MailThread features can be somewhat controlled through context keys :

     - ``mail_create_nosubscribe``: at create or message_post, do not subscribe
       uid to the record thread
     - ``mail_create_nolog``: at create, do not log the automatic '<Document>
       created' message
     - ``mail_notrack``: at create and write, do not perform the value tracking
       creating messages
     - ``tracking_disable``: at create and write, perform no MailThread features
       (auto subscription, tracking, post, ...)
     - ``mail_save_message_last_post``: at message_post, update message_last_post
       datetime field
     - ``mail_auto_delete``: auto delete mail notifications; True by default
       (technical hack for templates)
     - ``mail_notify_force_send``: if less than 50 email notifications to send,
       send them directly instead of using the queue; True by default
     - ``mail_notify_user_signature``: add the current user signature in
       email notifications; True by default
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất


You can do this via Settings -> Technical -> Email -> Subtypes.

Uncheck the checkbox "default" for your action to disable the messages.

Note: this is for version 7, idk if they changed this.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 6 16
3968
1
thg 5 16
6533
1
thg 12 23
4905
1
thg 2 25
1544
2
thg 12 24
2527