Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3880 Zobrazení

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
srp 19
3804
1
pro 21
6309
0
říj 21
2873
1
říj 21
3645
0
dub 21
1994