Hi,
In my module, I have multi-company. For example, One main company and multiple sub companies. I have accounts for only main company. Sub companies also comes under main company's account. Each sub companies have different users called sales users. I need to access 2 many2 one field (property_account_payable_id, property_account_receivable_id ) in res.partner.
I added record rule for account model for sales user. Domain also added in this record rule.
<field name="domain_force">[('company_id','in',[user.company_id.id,user.company_id.parent_id.id,False])]</field>
Partner created by admin. If I access these fields by admin, there will be no issues. But if I access these fields by sales user, I can't access these field's value. I used sudo() to access these account fields. But it never works.
account_id = partner.sudo().property_account_payable_id.id
I need to access these fields by sales user.