Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Let's see the classic example of a related field: you have an object city, which has a field state_id, and you need to show its country.
The object city has a field state_id, which is a many2one, and the object state has a field country_id, which is also a many2one.
Now, what would happen if the type of the field state_id were one2many (and the type of country_id kept being many2one)? How should I declare the related field country_id?
This is obviously a nosense with those fields, but it's only an example to make easier to understand my question.
If `state_id` was a `one2many` you could keep exactly the same syntax and it would work. The behavior for `fields.related` when going though a *2many relationship is to take the first record found (depending on the order of the target model), and then to continue. As to whether this makes any sense, it very much depends on the use case. It makes a bit more sense for read-only access than for changes through the related fields.
True, If you establish a related relation for One2many field would be indeed nonsense...
O2M of state is nothing but list of Records, and you establish a related for it which will be a single field, so resultant value will keep overriding with latest records ie states' country.. which is utterly meaningless..
Techincally speaking, this must be a bug, guess some how Odoo guys have overlooked this....
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
|Asked: 10/15/14, 5:43 AM|
|Seen: 1677 times|
|Last updated: 3/16/15, 8:10 AM|