Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
304 Widoki

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.



Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
sie 25
627
2
sie 25
696
1
sie 25
1312
2
sie 25
937
0
lip 25
728