Relationships between models
Looking again at our module design, we have these relationships:
- Each Task has a Stage. That's a many-to-one relationship, also known as a foreign key. The inverse is a one-to-many relationship, meaning that each Stage can have many Tasks.
- Each Task can have many Tags. That's a many-to-many relationship. The inverse relationship, of course, is also a many-to-many, since each Tag can be in many Tasks.
The following Entity Relationship Diagram can help visualizing the relationships we are about to create on the model. The lines ending with a triangle represent a many sides of the relationships:
Let's add the corresponding ...
Get Odoo 10 Development Essentials now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.