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
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
2
Réponses
26526
Vues
You can check it like
if 'FIELD_NAME' in self.env['product.product']._fields:
...
...
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire
if 'x_field' in x_obj:
....