Odoo Help


Whats the difference between 'other.object.name' and 'Field relation id'?

Lakay lakay
on 9/2/14, 4:04 AM 1,714 views

fields.one2many( 'other.object.name', 'Field relation id', 'Fieldname', optional parameter)

using a one2many relational field type,  whats the difference between 'other.object.name' and 'Field relation id'

i know the where to find the 'other.object.name'  it is simply the "class" in the python code(module.py) and the "model" in the openerp , but what about the 'Field relation id' where can i find this? Thx in advance..


René Schuster

--René Schuster--
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 9/2/14, 4:25 AM

As one2many fields are not really stored in with all related ids, you have to define a relation field id. This is the many2one field in the 'other.object.name' table, that links to your actual table.


m2o: child_class with field parent_class_id.
o2m: parent_class with field child_class_ids.   In this one2many field the 'other.object.name' is the name of the child_class (e.g. child.class) and the 'Field relation id' is parent_class_id.



could you help me im confused. i have this code: class si(osv.osv): _name='si' _columns ={ 'siid':fields.many2one('osa'), } si() class osa(osv.osv): _name='osa' _columns={ 'street':fields.char('Street',size=100,required=True), } osa() i have this existing code, as you can see the field 'siid' is many2one it means that it can only refer to a one class which is the 'osa' when you try to add value to the 'siid' field it will redirect you to the one (1) 'street' field and enter values then save. what will i need to do if when i add value to the 'siid' field it will enables me to enter many 'street' and this 'street' will have an identification that it was entered by the current user of the openerp (its like one2many | many 'street' just for one user). Do i need to add another field as their (ids) to both classes as their reference ?

Lakay lakay
on 9/2/14, 4:51 AM

I don't get you. Sorry.

René Schuster
on 9/2/14, 5:03 AM

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/2/14, 4:04 AM
Seen: 1714 times
Last updated: 3/16/15, 8:10 AM