We are getting login user in self.env.user, but i want to access login user in ir.action.act.window.
<record id="act_mail_messages_form_ept_closed" model="ir.actions.act_window">
<field name="name">Closed</field>
<field name="res_model">mail.message</field>
<field name="domain">[('model','=','res.partner'),('res_id','!=',False),('user.company_id','=',company_id)]</field>
<field name="context">{'readonly_by_pass': True,'check_domain':True}</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="view_message_search"/>
<field name="view_mode">tree,form</field>
</record>
My requirement is I want to filter data without creating record rule, because of if we create record rule of mail.message then system will very slow because for every record system will check record rule.
I want to filter company wise messages using domain in mail.message.
In mail.message i have company_id field (Custom field) and i want to filter data when action is calling.
Is there any alternative solution available to filter message without creating record rule or is there any way from that we can access login user in ir.action.act.window ?