Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3867 Vistas

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
Descartar
Mejor respuesta

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

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
ago 19
3778
1
dic 21
6296
0
oct 21
2861
1
oct 21
3609
0
abr 21
1968