Home
Shop
Contact us
KnowSystem
Docs
Appointments
0
Sign in
Contact Us
KnowSystem
Check whether model has attribute
Check whether model has attribute
odoo
if hasattr(MODEL, ATTR):
# do something
pass
Model
- object, e.g. self.env["sale.order"]
Attr
- field or method name, e.g. "active", "name_get"