Skip to Content
Menu
This question has been flagged
1 Atsakyti
3909 Rodiniai

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?
Portretas
Atmesti
Autorius 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)]"
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
8
vas. 17
8446
0
saus. 17
5958
2
vas. 24
12691
4
geg. 24
18160
1
spal. 22
3455