Search code examples
pythonxmlpython-2.7odooodoo-8

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


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.

enter image description here

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


Solution

  • 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()