Skip to Content
Menu
This question has been flagged
4 Replies
4758 Views

Odoo Version: 12 on odoo.shModul: sale_order​I already filter only the partner's shipping address via domain filter successfully but now I also have to filter the following: If a contact of a partner is selected as customer, I want to show the shipping addresses of it's parent.​

I tried the following:

["parent.id","=",partner_id.parent_id]​

but there is an error like: partner_id does not have the attribute parent_id

Avatar
Discard

Adding domain from py or XML?

Author

from xml

Best Answer

Similar problem: https://www.odoo.com/forum/help-1/question/field-domain-150494#answer-150498

Probably solution for you is: [("parent_id","=",partner_id.parent_id)]​

Avatar
Discard
Best Answer

Please check the partner_id is a browsable object of res.partner model, if not it will raise the same error.

Avatar
Discard
Author

Thank you Hilar,

I think you are on the right track. The error message is:

Uncaught Error: AttributeError: object has no attribute 'parent'

when I try to access the parent via

["parent.id","=",partner.parent_id]​

However I don't know how to make the partner model browsable in the view.

I would appreciate a hint in the right direction.