Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Is 'name' attribute in tag 'field' of value 'name' always required in v7 xml view ?

By
David Béal
on 12/18/13, 7:35 AM 1,042 views

It's a question for OpenERP SA.

In v7, if you don't use <field name="name">...</field>, a default value is taken into account in database (see image).

<record id="view_partner_xxxx_form" model="ir.ui.view">
    <field name="name">res.partner.YYYYYY.form</field>
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.view_partner_xxxxx_form" />
    <field name="arch" type="xml">
        <xpath expr="/form/sheet/notebook" position="inside">

....

Might we consider like a good practice (I think that yes) to no more define this tag/attribute in most of views except if i want to define an specific name for a specific use.

If yes, there'll no more string like that

<field name="name">res.partner.the.name.than.i.defined.like.this.or.like.this.because.it's.an.odd.day.form</field>
   or
<field name="name">res.partner.grandmother.goes.well.form</field>

Default behaviour

image description

Thanks for the response.

In Form view header shows always model Field "name" value. If name field is not available in the model then its shows "(model.name , record_id)" or if we define _rec_name = 'field_name' in python its shows "field_value"

Prakash
on 12/18/13, 8:23 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 12/18/13, 7:35 AM
Seen: 1042 times
Last updated: 3/16/15, 8:10 AM