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

OpenERP 7 One2many relationship

By
Ashish Singh
on 7/25/14, 12:39 AM 1,947 views

Hello Guys

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

Thanks

0

Nehal

--Nehal--
2090
| 5 2 8
Ahmadabad, India
--Nehal--
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

0

Odoo

--Odoo --
1328
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

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'

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

2 follower(s)

Stats

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