Why the title is showing the record ID number when I edit a form in Odoo 8?

社会主义新天地 提交于 2019-12-11 04:35:02

问题


I have been using Odoo for developing modules. I need to ask that when I try to edit a form after saving, I see a form id num with the model name on top of the form.

Like the one shown in the screenshot. "hr.visa.request,1" is being shown on top which is the name of the model. I cant do anything with the model name because it has to be given in the form view. I dont know what I am doing wrong here. PLz guide me on this. Thanks n Regards


回答1:


Maybe you have a table without a name field. You need to define the _rec_name attribute of the model. _rec_name takes as default the field name and if this does not exist it does not take anything unless you specify it. For instance if you need to see the field phone you must write:

_rec_name = 'phone'

In case you want a _rec_name depending on anything you need to change the function name_get()



来源:https://stackoverflow.com/questions/31267175/why-the-title-is-showing-the-record-id-number-when-i-edit-a-form-in-odoo-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!