port5432
port5432

Reputation: 6403

Difference between name and id in an OpenERP form

The code below is a snippet from an OpenERP xml form definition.

<record model="ir.ui.view" id="direct_supplier_invoice_form">
        <field name="name">direct_supplier.invoice.form</field>
        <field name="model">account.invoice</field>
        <field name="type">form</field>
        <field name="inherit_id" eval="False" />
        <field name="priority">250</field>
        <field name="arch" type="xml">

It has two fields that seem very similair:

id="direct_supplier_invoice_form"
<field name="name">direct_supplier.invoice.form</field>

What is the specific purpose of these two fields?

Upvotes: 0

Views: 216

Answers (2)

Bazzinga...
Bazzinga...

Reputation: 1004

that's an XML code...

Name refers to the name of the field or record

while ID refers to its reference name so that whenever you are going to access the particular record or field you will have to use its ID.

Upvotes: 0

CZoellner
CZoellner

Reputation: 14776

name: is simply the name of the record (field name)

id: is also called xml_id, it's like a name for the records id. Why is there a name for an id? So you can reference to that id by name instead of numbers (which can vary from installation to installation). Where are these names saved in db? Just look into table ir_model_data.

I bet you've already used these id-names for references :-)

Upvotes: 2

Related Questions