2
votes

I am using odoo 10e. I want to change companies form and tree view. So i was following this tutorial Help

and this is what i tried but its not working

<odoo>
<data>
    <record model="ir.ui.view" id="view_crm_lead_form_inherited">
        <field name="model">res.company</field>
        <field name="inherit_id" ref="base.view_company_form" />
        <field name="arch" type="xml">
            <field name="name" position="attributes">
                <attribute name="string">Custodian Name</attribute>
            </field>
        </field>
    </record>
</data>
</odoo>

I see that company model have a field nameand i am trying to override default label of name fields.

Edit

__manifest__.py

   # -*- coding: utf-8 -*-
   {
    'name': "Test",

'summary': """
    Short (1 phrase/line) summary of the module's purpose, used as
    subtitle on modules listing or apps.openerp.com""",

'description': """
    Long description of module's purpose
""",

'author': "Ancient",
'website': "http://www.google.com",

# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# for the full list
'category': 'Accounting',
'version': '0.1',

# any module necessary for this one to work correctly
'depends': ['base', 'mail'],

# always loaded
'data': [
    'security/ir.model.access.csv',
    'security/amgl_security.xml',
    'views/views.xml',
    'views/customer.xml',
    'views/dashboard.xml',
    'views/products.xml',
    'views/order.xml',
    'views/order_line.xml',
    'views/metal_movement.xml',
    'views/possible_solutions.xml',
    'views/possible_reasons.xml',
    'views/pending_accounts.xml',
    'views/dealer.xml',
    'emailTemplates/mmr_create_mail.xml',
    'emailTemplates/reject_mmr_email.xml',
    'emailTemplates/mmr_approval_complete.xml',
    'emailTemplates/mmr_approve_reject_button.xml',
    'report/metal_movement_template.xml',
    'report/metal_movement_view.xml',
    'views/res_company.xml'
],
'qweb': [
    "views/colspan.xml",
],
# only loaded in demonstration mode
'demo': [
    'demo/demo.xml',
    'demo/customer_view.xml'
]
}
1
Have you provided the path to this file in your __manifest__.py?tidylobster
Yes i do, just forgot to mention in questionAncient
hmm, try to set up primary mode, i.e. add <field name="mode">primary</field> before archtidylobster
tired, but this doesn't make any difference !!!!Ancient
Why do you want to change the field name string attribute?jo541

1 Answers

2
votes

Here the important part of the origin view:

<div class="oe_title">
    <label for="name" class="oe_edit_only"/>
    <h1>
        <field name="name" class="oe_inline"/>
    </h1>
    <label for="rml_header1" class="oe_edit_only"/>
    <h3>
        <field name="rml_header1" placeholder="e.g. Global Business Solutions"/>
    </h3>
</div>

You have to change the label, because the field label, which you try to override, is never used.

Following should work:

<label for="name" position="attributes">
    <attribute name="string">Custodian Name</attribute>
    <attribute name="for" />
</label>