12 lines
458 B
Python
12 lines
458 B
Python
from odoo import models, api
|
|
|
|
|
|
class Message(models.Model):
|
|
_inherit = 'mail.message'
|
|
|
|
|
|
@api.model
|
|
def _find_allowed_model_wise(self, doc_model, doc_dict):
|
|
doc_ids = list(doc_dict)
|
|
allowed_doc_ids = self.env[doc_model].with_context(active_test=False).search([('id', 'in', doc_ids)]).ids
|
|
return set([message_id for allowed_doc_id in allowed_doc_ids if allowed_doc_id in doc_dict for message_id in doc_dict[allowed_doc_id]]) |