Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
3038 Prikazi

I have a class like this:

class Test:
  _inherit = "some_model"
  test = fields.Many2one('res.partner', domain=[('parent_id', '=', super_field)])

super_field is defined in some_model, how can I make my test field here use a domain with super_field?
Avatar
Opusti
Avtor Best Answer

I solved it long time ago but putting my answer here for closure.


To do this just pass the domain as string:

 domain="[('parent_id', '=', super_field)]"
Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
8
feb. 17
7530
0
jan. 17
5198
2
feb. 24
11820
4
maj 24
16658
1
okt. 22
2551