コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3469 ビュー

Hello,

I've created my own module and I want to add attributes to a tree present in my view.

I've create this inherit views but I've got a problem with the addition of attributes for my tree.


This my code for change my parent form view:

<record id="hide_create_registred_tree" model="ir.ui.view">

<field name="name">hide.create.register.tree</field>

<field name="model">training.actions</field>

<field name="inherit_id" ref="x_training.training_actions_form"/>

<field name="type">form</field>

<field name="arch" type="xml">

<xpath expr="//field[@name='registred']/tree" position="attributes">

<attribute name="create">False</attribute>

</xpath>

<xpath expr="//field[@name='blocking_registrations']" position="after">

<field name="max_trained"/>

</xpath>

</field>

</record>



When I go to my module and I click on the button "Create" nothing appends.

If I remove this part of my code :

<xpath expr="//field[@name='registred']/tree" position="attributes">

<attribute name="create">False</attribute>

</xpath>



I can open the parent form by clicking on button "Create".

What's wrong ?

Thanks for your help.

Regards 

アバター
破棄

TIP for pasting code... please put it first through this tool:
https://www.online-toolz.com/tools/text-html-entities-convertor.php
I will convert all brackets, slashes to enities ... then paste it again.. I know this editor is helly buggy

IS THIS YOUR CODE?
<pre>
<field name="name">hide.create.register.tree</field>
<field name="model">training.actions</field>
<field name="inherit_id" ref="x_training.training_actions_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='registred']/tree" position="attributes">
<attribute name="create">False</attribute>
</xpath>
<xpath expr="//field[@name='blocking_registrations']" position="after">
<field name="max_trained"/>
</xpath>
</field>
</pre>

著作者

Thanks Krys.Raj
This my code.
I update my post

最善の回答

Hi,

<record id="hide_create_registred_tree" model="ir.ui.view">
<field name="name">hide.create.register.tree</field>
<field name="model">training.actions</field>
<field name="inherit_id" ref="x_training.training_actions_form"/>
    <field name="type">form</field>
    <field name="arch" type="xml">
<xpath expr="//field[@name='registred']/tree" position="attributes">
            <attribute name="create">0</attribute>
        </xpath>
<xpath expr="//field[@name='blocking_registrations']" position="after">
            <field name="max_trained"/>
        </xpath>
    </field>
</record>
Also, make sure that the ref="x_training.training_actions_form" reference is correct


Hope it helps

アバター
破棄
関連投稿 返信 ビュー 活動
0
4月 22
2171
1
4月 17
2895
1
2月 23
8021
2
5月 22
2865
1
5月 22
3557