Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1725 Lượt xem

I want to modify on user portl the documents view. I do not want to show the drop down menu on search (so no click on arrow) or disable the modal.

First I tried to see if working to diable from modal some links and is working with this. What is not working that I want ONLY for portal users to disable, the internal users to have the original search.


Anyone knows what I am doing wrong in Odoo 18?

<odoo>

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

        <field name="name">documents.document.search.inherit</field>

        <field name="model">documents.document</field>

        <field name="inherit_id" ref="documents.document_view_search"/>

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

            <xpath expr="//filter[@name='filter_owner_id']" position="attributes">

                <attribute name="invisible">1</attribute>

                <attribute name="groups">base.group_portal,base.group_public,base.group_user</attribute>

            </xpath>

            <xpath expr="//filter[@name='filter_partner_id']" position="attributes">

                <attribute name="invisible">1</attribute>

            </xpath>

            <xpath expr="//filter[@name='filter_res_model']" position="attributes">

                <attribute name="invisible">1</attribute>

            </xpath>

            <xpath expr="//filter[@name='filter_create_date']" position="attributes">

                <attribute name="invisible">1</attribute>

            </xpath>

            <xpath expr="//filter[@name='filter_file_extension']" position="attributes">

                <attribute name="invisible">1</attribute>

            </xpath>

        </field>

    </record>

</odoo>




Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Instead of trying to hide them with invisible, you can use groups to make filters only visible to internal users, i.e. base.group_user. Portal and public users will no longer see them.


code:


<odoo>

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

        <field name="name">documents.document.search.inherit</field>

        <field name="model">documents.document</field>

        <field name="inherit_id" ref="documents.document_view_search"/>

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


            <xpath expr="//filter[@name='filter_owner_id']" position="attributes">

                <attribute name="groups">base.group_user</attribute>

            </xpath>


            <xpath expr="//filter[@name='filter_partner_id']" position="attributes">

                <attribute name="groups">base.group_user</attribute>

            </xpath>


            <xpath expr="//filter[@name='filter_res_model']" position="attributes">

                <attribute name="groups">base.group_user</attribute>

            </xpath>


            <xpath expr="//filter[@name='filter_create_date']" position="attributes">

                <attribute name="groups">base.group_user</attribute>

            </xpath>


            <xpath expr="//filter[@name='filter_file_extension']" position="attributes">

                <attribute name="groups">base.group_user</attribute>

            </xpath>


        </field>

    </record>

</odoo>


Hope it helps.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 7 23
6615
1
thg 12 21
2822
0
thg 5 20
2691
1
thg 1 20
3418
3
thg 7 19
4071