Odoo Help

0

How to create a static field in a class ?

By
samir Guesmi
on 9/3/13, 11:59 AM 1,019 views

Hi guys !

I want to add a field who has all the time the same value (for every objects of his class).

How can i do that ?

Thanks.

0
Xsias
On 9/3/13, 12:23 PM

You can create a field in python like that :

_columns = {
    'my_field' : fields.char('My static field', size=64),
}
_defaults = {
    'my_field': lambda *a: 'The default value',
}

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 9/3/13, 11:59 AM
Seen: 1019 times
Last updated: 3/16/15, 8:10 AM