Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
272 Переглядів

Hi guys!!!!

Please who can help me guys please.

I have a many2ne field named "project_id" liked to project_service class. But, it shows me a stucture like this 'project_id': (5, 'project_service,5').

Who can help me why it does display structure like thios. Why dont i get only the id (5)???

Please help

Аватар
Відмінити
Найкраща відповідь

This field won't show you id on web client but value only, it shows value of rec_name column, best practice is to use 'name'. it is default value of 'rec_name' for a table, if you don't have name column then you must explicitly tell odoo, which field should be used as rec_name.

So in your case table 'project_service' should have a field 'name'. if you don't have 'name' field you must set a column as 'rec_name'.

Аватар
Відмінити
Автор

Thanks a lot for the answer. In fact, i have a colum setted rec_name. So the manyone will contain (id, rec_name colum) is it normal??

if you are seeing it at backend it is normal, because m2o is a field referencing value of another table, 'id' is primary key of foreign table, and column name is the name from which value will be taken, If you are seeing this on web client then it is not normal you have some thing wrong, if you want to access id of that value you can do like : object_name.m2o_field.id for value you can do : object_name.m2o_field.column_name(rec_name)

Related Posts Відповіді Переглядів Дія
0
бер. 25
1420
0
січ. 25
3502
1
серп. 23
14868
change password Вирішено
1
серп. 23
13515
1
лип. 23
10497