2017-10-19 4 views
2

私はodoo 10eを使用しています。私は企業のフォームとツリービューを変更したい。だから私はこのチュートリアル HelpOdoo - デフォルトの会社の表示を無効にする

に従っていましたし、これは私が試したものですが、そのは

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

を働いていない私は、会社のモデルがフィールドnameを持っていると私は名前フィールドのデフォルトのラベルを上書きしようとしていていることがわかります。

編集ここ

__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' 
] 
} 
+0

があなたの '__manifest __ py'でこのファイルへのパスを提供してきましたか? – tidylobster

+0

はい、私はちょうど質問に言及するのを忘れた – Ancient

+0

ええと、プライマリモードを設定してください、すなわち ''フィールド名= "モード">を追加してください "' 'アーチ'の前に – tidylobster

答えて

2

原点ビューの重要な部分:あなたはラベルを変更する必要が

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

、フィールドラベル理由あなたが上書きしようとしているものは使用されません。動作するはずです後

:。

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

これは正常です。同じアプローチを使用することで、ツリービューで作成ボタンの上に表示されるメニュー名とそのタイトルも変更できますか? – Ancient

+1

これもうまくいくはずです。モデルは 'ir.ui.menu'で、あなたが探している外部IDは' base.menu_action_res_company_form'です。 – CZoellner

+0

ありがとうございました。 – Ancient

関連する問題