Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to get the list of mandatory fields of an object using orm methods?

By
Vivekrajan
on 11/18/13, 8:39 AM 662 views

Hi,

I would like know the way to get the list of mandatory fields from any object.

Will any orm method be some help?

your support is appreciated much.

thanks

0
Vivekrajan
On 11/18/13, 8:54 AM

Hi,

My colleague found the logic for this.

fields = self.pool.get('sale.order').fields_get(cr, uid)

required_fields = [field for field in fields if 'required' in fields[field] and fields[field]['required']]

print required_fields

Thanks

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/18/13, 8:39 AM
Seen: 662 times
Last updated: 3/16/15, 8:10 AM