2016-04-26 7 views
0

odoo 8には、読み込みメッセージが表示されるアーカイブというメニューがありましたが、odoo 9ではそのようなことはありません。
読み取りメッセージの表示方法やフィルターの使用方法を知っている人はいませんか?同様にアバターを送信することも表示されていません。こうした工程を経てODOO9移動中にメッセージを表示するためのodoo 9の古いメッセージを表示するには?

答えて

0

私は自分自身でいくつかの研究を行った。私は受信トレイのフォルダにメッセージを残して、隠しておく方法を見つけました。ここに私の方法です。

mail.messageにアクティブなフィールドとカスタムフィルタを作成し、以下のようにset_message_doneメソッドを上書きします。

@api.multi 
def set_message_done(self, partner_ids=None): 
    """ Remove the needaction from messages for the current partner. """ 
    partner_id = self.env.user.partner_id 
    self.active = False 
    messages = self.filtered(lambda msg: partner_id in msg.needaction_partner_ids) 
    if not len(messages): 
     return 
    #messages.sudo().write({'needaction_partner_ids': [(3, partner_id.id)]}) 
    # notifies changes in messages through the bus. To minimize the number of 
    # notifications, we need to group the messages depending on their channel_ids 
    groups = [] 
    current_channel_ids = messages[0].channel_ids 
    current_group = [] 
    for record in messages: 
     if record.channel_ids == current_channel_ids: 
      current_group.append(record.id) 
     else: 
      groups.append((current_group, current_channel_ids)) 
      current_group = [record.id] 
      current_channel_ids = record.channel_ids 

    groups.append((current_group, current_channel_ids)) 
    current_group = [record.id] 
    current_channel_ids = record.channel_ids 

    for (msg_ids, channel_ids) in groups: 
     notification = {'type': 'mark_as_read', 'message_ids': msg_ids, 'channel_ids': [c.id for c in channel_ids]} 
     self.env['bus.bus'].sendone((self._cr.dbname, 'res.partner', partner_id.id), notification) 

要約:私は書き込み行にコメントして、self.active = falseを追加します。メソッドはメッセージを削除せずに非表示にします。それでもメッセージ未読数バブルがありました。

次に、res.partnerのget_needaction_countを上書きし、単純なロジックを追加します。

@api.model 
def get_needaction_count(self): 
    """ compute the number of needaction of the current user """ 
    if self.env.user.partner_id: 
     id = [] 
     active_msg = self.env['mail.message'].search([('active','=',True)]) 
     for x in active_msg: 
      for rec in x.partner_ids: 
       id += [rec.id] 
     if self.env.user.partner_id in id: 
      return len(active_msg) 
    _logger.error('Call to needaction_count without partner_id') 
    return 0 
1

  1. 開発者モードを有効にします。
  2. 設定 - >技術 - >電子メール - >Messageにアクセスしてください。

メッセージメニューには、すべてのメッセージのリストがあります。

これがあなたを助けてくれることを願っています。

+0

でメール/メッセージングを改善すること、プロジェクトLLCから新しいモジュールがあるので、これは従業員が –

+0

ユーザーが使用することができます彼らの古いメッセージは、カスタムオープンフィルタ見るべきであるか管理者のためでありますこのリンク: - > http://prntscr.com/awzyof – prakash

+0

が表示されません。 https://www.dropbox.com/sh/5gv2xr9v4x7q2o6/AACO6agOs-dQZkWb5BrgRYcCa?dl=0 –

関連する問題