Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
26629 Переглядів

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.

Аватар
Відмінити

if 'x_field' in x_obj:

....

Найкраща відповідь

You can check it like

if 'FIELD_NAME' in self.env['product.product']._fields:
...
...
Аватар
Відмінити