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

Hi,

I would like know the way to get the list of mandatory fields from any object.

Will any orm method be some help?

your support is appreciated much.

thanks

Avatar
Descartar
Autor Mejor respuesta

Hi,

My colleague found the logic for this.

fields = self.pool.get('sale.order').fields_get(cr, uid)

required_fields = [field for field in fields if 'required' in fields[field] and fields[field]['required']]

print required_fields

Thanks

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
4
dic 19
6234
0
mar 17
4578
1
ene 17
9660
3
oct 24
14247
2
mar 15
4977