Odoo Help

0

OpenERP 7 One2many relationship

By
Ashish Singh
on 7/25/14, 12:39 AM 2,374 views

Hello Guys

I am always confuse when we use "one2many" and "many2one"  relationship in table of  Openerp 7

Thanks

0
Odoo
On 7/25/14, 1:02 AM

take a scenario- suppose one author writes n books we can mark that field as one2many relation and in one2many line we can add only the data. MANY2one take an example of student.one student relates to one division then we use many2one relation like -student_name:fields.may2one('student.ifo','Student Name') in many2one relation we can create and edit option available also we can select the data .

Try this  code--

 

'library_line_id':fields.one2many('library.form.line','library_id','Books',required=True,readonly=True,select=True,states={'draft':[('readonly', False)]}) 'library_id':fields.many2one('library.form','Library Form line'

0
Nehal
On 7/25/14, 12:51 AM

HI,

Refer the following link,it may help you:
https://doc.odoo.com/6.0/developer/2_5_Objects_Fields_Methods/field_type/#relational-types

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

2 follower(s)

Stats

Asked: 7/25/14, 12:39 AM
Seen: 2374 times
Last updated: 3/16/15, 8:10 AM