问题
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