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 set value to another class member in openErp

By
shameem
on 2/13/15, 1:01 AM 571 views

Hai,

I will declare two class, these two class have two field also,. I will select value(one class member field in drope down list) from field in the first class memebr, the it can be set to another class memebr field. How it possible

2

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 2/13/15, 2:33 AM

hi.you can set it by using related field.

Try this example:

class first_table(osv.osv):
    _name = "first.table"
    _columns = {
       'field1' : fields.many2one('res.partner','Field1'),

        'field2' : fields.integer('Field2'),

}

class second_table(osv.osv):
    _name = "second.table"
    _inherit = "first.table"
    _columns = {
       'field3' : fields.many2one('first.table','Field3'),

        'field4' : fields.related('field3','field1', type='many2one', string='Field4',store=True),


}

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: 2/13/15, 1:01 AM
Seen: 571 times
Last updated: 3/16/15, 8:10 AM