This question has been flagged

I am having trouble trying to understand the architecture of the relational fields and how they relate to the others.

I am trying to create a char field on the mail\.activity\.view\.form\.popup view\.\ than\ I\ would\ like\ to\ reference\ this\ field\ from\ the\ crm.lead.kanban.lead view. I have been trying to do this for a few days now and a lot of these explanations are not making any sense to me.

Avatar
Discard
Best Answer

Odoo has 3 types of relations:

1) Many2oneA simple link to an other object.
    * Will be shown as a dropdown menu.

    * Can have a relation with tha same model to act as Parent/Child relation.

    * You can use related attribute to get access to a field in data in the model you are building a relation with.

2) One2many: A virtual relationship, inverse of a Many2one. A One2many behaves as a container of records.
    * Will be shown as a table with unique lines.
    * Needs a Many2one relation to work.

3) Many2many:  Bidirectional multiple relationship, any record on one side can be related to any number of records on the other side. Behaves as a container of records.

    * Will be shown as a table with multiple options that you can choose from and they are not unique to a model.
    * Have an optional reverse Many2many relation with the model you are tying to make relation with.


Read more about how Odoo relations work from Odoo Docs here.



Happy to help :) an upvote will be awesome

Avatar
Discard
Author

Thanks:) I have posted another question about sharing form data between models. Can you explain more about the related field? my understanding is this, but it won't work...
this is just an example, not what i am actually trying to put into the field:
model.id.many2one.datamember