I have a model res_partner_attributes. Before updating specific field say x_myNumber, how to check if the field exists? If the field does not exist then create the field and update its value.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
2
Respuestas
26554
Vistas
You can check it like
if 'FIELD_NAME' in self.env['product.product']._fields:
...
...
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
Inscribirse
if 'x_field' in x_obj:
....