Skip to Content
Menu
This question has been flagged
3 Replies
8111 Views

I'm currently setting up odoo for our company. I'm working with odoo Online (v12) (using odoo Studio).

I created new model Estates (x_estate) that contains many2many field called x_partners (relation: res.partner).

In our workflow, we'd like to assign an estate to every Sale Order Line, so I added a new field "Estate" to the list view of the Sale Order Lines.

As a lot of estates have the same name, I'd like to filter the choices depending on the Customer that is selected in the Sales Order.

I tried to achieve this using domain and context but didn't come to the expected result. 

Context: {"parent_partner_id":parent.partner_id}

Domain: [["x_partners","ilike","parent_partner_id"]]

I guess I lack some technical comprehension of how this works and I'll be happy for any help. Is it even possible to achieve this with odoo Studio?

Avatar
Discard
Best Answer
If I understood the problem well, try it:
Domain: [('x_partners','=','parent.partner_id')]
Avatar
Discard
Best Answer

try to add this in the XML: domain="[('x_partners','=',parent.partner_id)]"

Avatar
Discard
Author Best Answer

@Zbik

Thanks for your response. I just tried applying Domain: [('x_partners','=','parent.partner_id')]

There's no error but the estates dropdown in Sales Order Line doesn't show any values.

Avatar
Discard

Sorry, my mistake. Remove quote characters in parent.partner_id. [('x_partners','=',parent.partner_id)]

Author

It seems that this is not possible in odoo Studio. When I try to save the domain, it says: "The domain you entered is not properly formed"..

Hi, I got the same problem with Studio. I don't know how to remove the quotes :-(

I also have this issue.

Related Posts Replies Views Activity
5
Oct 24
9764
1
May 21
4347
0
May 21
1512
3
Oct 18
2920
0
Jan 23
1021