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

Hello! I've set a default value for one of the fields in my model. It's stored in ir.default model (I found it in Settings -> Technical -> User-defined Defaults).
How can I show the value of this variable in my form view?

That's how I've set the value:

def set_default_value(self, value):
        IrValues = self.env['ir.default'].sudo()
        IrValues.set('my.model.model', 'my field', value.name)
        return IrValues

Now I wont to show the value of this field in view (view built by Transientmodel)

How can I call it?

Avatar
Opusti
Best Answer

my_field = IrValues.get('my.model.model', 'my_field')

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
avg. 19
3887
1
dec. 21
6363
0
okt. 21
2925
1
okt. 21
3723
0
apr. 21
2059