Reputation: 22784
How to programmatically display a model's fields names? (let us say the model res.partner
)
I know I can check them manually by activating the developer mode, but I need to list them programmatically.
Upvotes: 1
Views: 731
Reputation: 6428
You can use this:
env["res.partner"].fields_get()
It returns a dict()
with all details in a very usable format. It includes things such as the field name in the user's language, or possible selections for Selection
fields.
Depending on your use, it can be more handy than just ._fields
.
Upvotes: 2