콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

i'm writing a ticketing module and i need the assigned employee to a specific ticket to be automatically follow the ticket the thing as is it followers are added form res.partner model and i need to add them from hr.employee and res.partner

here is my work around 

python:

class ticket(models.Model):

_name = 'itmangement.ticket'

_description = 'IT Ticket Management Process'

_inherit = ['mail.thread', 'ir.needaction_mixin']

        #some other fields

        assigned_to_id = fields.Many2many('hr.employee', string="Assigned To")

        employee_message_follower_ids=fields.Many2many('hr.employee')

        @api.one

        def action_assign(self):

             self.employee_message_follower_ids = [(6,0,self.assigned_to_id.ids)]

and the view:
<div class="oe_chatter">
    <field name="message_follower_ids" widget="mail_followers"/>
    <field name="message_ids" widget="mail_thread"/>
</div>
<div class="oe_chatter">
    <field name="employee_message_follower_ids" widget="mail_followers"/>
</div>
아바타
취소
관련 게시물 답글 화면 활동
0
12월 24
965
2
10월 23
5716
3
9월 23
2563
0
6월 23
2698
0
5월 23
2580