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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
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)]"
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Olİlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
---|---|---|---|---|
|
8
Şub 17
|
8363 | ||
|
0
Oca 17
|
5874 | ||
|
2
Şub 24
|
12578 | ||
|
4
May 24
|
17917 | ||
|
1
Eki 22
|
3333 |