跳至内容
菜单
此问题已终结
1 回复
288 查看

In Odoo CRM Modul > configuration > Stages, there's a view of CRM Stages, Editable.
How to make it read-only for all?

I'm making a module to update CRM behaviour.

I was expecting something like this could work:


<odoo>
    <record id="myid_readonly" model="ir.ui.view">
        <field name="name">crm.stage.tree.readonly</field>
        <field name="model">crm.stage</field>
        <field name="inherit_id" ref="crm.crm_stage_tree"/>
        <field name="priority">9</field>
        <field name="arch" type="xml">
            <list position="attributes">
                <attribute name="edit">false</attribute>
                <attribute name="create">false</attribute>
                <attribute name="reorder">false</attribute>
            </list>
        </field>
    </record>
</odoo>

 

odoo.tools.convert.ParseError: while parsing /mnt/addons/mymodul/views/crm_stage_views.xml:16
Invalid view crm.stage.tree.readonly definition in mymodul/views/myviews.xml

View error context:
'-no context-'


I found out that view architecture is:

<list string="Stages" multi_edit="1">
    <field name="sequence" widget="handle"/>
    <field name="name" readonly="1"/>
    <field name="is_won"/>
    <field name="team_id"/>
</list>

Not sure how to put these together.



形象
丢弃
最佳答案

Hi,

Please refer to the code:


<odoo>

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

        <field name="name">crm.stage.tree.readonly</field>

        <field name="model">crm.stage</field>

        <field name="inherit_id" ref="crm.crm_stage_tree"/>

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

            <xpath expr="//list" position="attributes">

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

                <attribute name="edit">false</attribute>

                <attribute name="delete">false</attribute>

            </xpath>

        </field>

    </record>

</odoo>


Hope it helps.

形象
丢弃
相关帖文 回复 查看 活动
0
8月 25
620
2
8月 25
692
1
8月 25
1308
2
8月 25
933
0
7月 25
727