Search code examples
pythonxmlodooodoo-8

Change title of automatically generated form view in Odoo


I want to change the heading of form view in the grey area. (Check image below.)

This should have to be changed from SHIP00001 to some other name or field. Is that possible?

Example


Solution

  • The name in the form view is gotten in two ways

    1. From a field which you specified name of the field (i.e name = fields.Char('Field name'))
    2. and when you set _rec_name to some other field or you override _name_get to set a custom name

    so what you can simply do is set

    _rec_name to another field in your model

    That's the name that will show up the form heading or in the drop down field of any other model where you have a relation to it.