View unanswered posts | View active topics
|
Page 1 of 1
|
[ 4 posts ] |
|
| Author |
Message |
|
kilrou
|
Post subject: [Solved] Simple explanation of one2many, many2one... Posted: Tue Aug 02, 2011 5:00 pm |
|
Joined: Mon May 16, 2011 4:20 pm Posts: 27
|
|
Hello,
as the subject suggests, would you have a simple explanation of these three fields, it's difficult to capture their interest and in which situation to use one over the other.
Thank you in advance.
Last edited by kilrou on Wed Aug 03, 2011 10:31 am, edited 1 time in total.
|
|
| Top |
|
 |
|
hummingbird
|
Post subject: Re: Simple explanation of one2many, many2one, many2many fiel Posted: Wed Aug 03, 2011 12:47 am |
|
Joined: Fri May 21, 2010 10:03 pm Posts: 94 Location: Belize
|
|
one2many: invoice->invoice_line An invoice has many lines. In the database the lines each have a reference to their invoice.
many2one: invoice->partner Many invoices belong to a partner. In the database the invoices each have a reference to their partner.
many2many: users<->groups A user belongs to many groups and a group has many users. Or A user has many groups and a group belongs to many users. It works both ways. In the database a separate table has a user-group reference pair for each relation.
|
|
| Top |
|
 |
|
gdaddy
|
Post subject: Re: Simple explanation of one2many, many2one, many2many fiel Posted: Wed Aug 03, 2011 1:55 am |
|
Joined: Wed Jan 27, 2010 6:21 pm Posts: 797 Location: Auckland, NZ
|
|
The explanation is correct in simple terms and common understanding, but in relational database terms it is more like
one2many An invoice has 0,1 or many lines. Note this is an important distinction as the one2one field type has been deprecated.
many2many A user belongs to 0,1 or many groups and a group has 0,1, or many users.
_________________ Graeme
|
|
| Top |
|
 |
|
kilrou
|
Post subject: Re: Simple explanation of one2many, many2one, many2many fiel Posted: Wed Aug 03, 2011 10:30 am |
|
Joined: Mon May 16, 2011 4:20 pm Posts: 27
|
|
Thanks for your good explanations.
Best regards.
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 4 posts ] |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|