I create a methode in claim model that return the current user
@api.model def get_current_user_parent_partner_id(self):
current_user = self.env.user
parent_partner_id = current_user.partner_id.parent_id.id
return parent_partner_id
and this the XMl code that I Write it
I List Of Claims
claim
[('create_uid.partner_id.parent_id.id', '=', context.get('parent_partner_id'))]
I had Errors when I call the method
how can I well call this method
I use odoo 17
This is the Full code
@api.model
def get_current_user_parent_partner_id(self):
current_user = self.env.user
parent_partner_id = current_user.partner_id.parent_id.id
return parent_partner_id
- XMl code that I Write it
<record id="ca_claim_action" model="ir.actions.act_window">
<field name= "name">I List Of Claims</field>
<field name= "res_model">claim</field>
<{"parent_partner_id": get_current_user_parent_partner_id()}</field>
<field name="domain">[('create_uid.partner_id.parent_id.id', '=', context.get('parent_partner_id'))]</field> </record>