Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

How to add a group to inherited view odoo16

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
viewsgroupsodoo16features
3 Antworten
15897 Ansichten
Avatar
Rama Altayeb

I am inheriting a view and I want to add a group to it:

  

        <record id="inherited_view_attendance_tree" model="ir.ui.view&qout;>
           <field name="name">my_inherited_hr_attendance_view</field>
            <field name="model">hr.attendance</field>
            <field name="inherit_id" ref="hr_attendance.view_attendance_tree"/>
            <field name="groups_id" eval="[(4, ref('hr_attendance.group_hr_attendance_user'))]"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='worked_hours']" position="attributes">
                    <attribute name="invisible">True</attribute>
                </xpath>
            </field>
        </record>








And I am getting an error like this


odoo.tools.convert.ParseError: while parsing /mnt/extra-addons/my_project_name/views/hr_attendance.xml:5
Inherited view cannot have 'Groups' define on the record. Use 'groups' attributes inside the view definition

How to solve this issue?

2
Avatar
Verwerfen
Avatar
Rama Altayeb
Autor Beste Antwort

I found the answer like this


<record id="inherited_view_attendance_tree" model="ir.ui.view&qout;>           <field name="name">my_inherited_hr_attendance_view</field>
            <field name="model">hr.attendance</field>
            <field name="inherit_id" ref="hr_attendance.view_attendance_tree"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='worked_hours']" position="attributes">
                    <t groups="hr_attendance.group_hr_attendance_user">
                        <attribute name="invisible">True</attribute>
                    </t>
                </xpath>
            </field>
        </record>


0
Avatar
Verwerfen
Globalist Technology

I don't think this is a proper solution. It's not working as expected.

Avatar
AKRAM
Beste Antwort

Hello RamaAltayed,

I tested your solution, but the element became hidden for all groups !!
can you help me ?

Below my code:

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


    <field name="name">hide.order.line.for.pss.group</field>


    <field name="model">sale.order</field>


    <field name="inherit_id" ref="sale.view_order_form"/>


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


        <xpath expr="//page[@name='order_lines']" position="attributes">


            <t groups="ns_crm.ns_crm_pss_team">


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


            </t>


        </xpath>


        <xpath expr="//page[@name='customer_signature']" position="attributes">


            <t groups="ns_crm.ns_crm_pss_team">


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


            </t>


        </xpath>


    </field>


</record>




1
Avatar
Verwerfen
Rama Altayeb
Autor

Yes of course,
Please share your code

AKRAM

below my code:
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9,8pt;"><span style="color:#e8bf6a;">&lt;record </span><span style="color:#bababa;">id</span><span style="color:#6a8759;">=&quot;inherit_view_quotation_form_pss_hide_element&quot; </span><span style="color:#bababa;">model</span><span style="color:#6a8759;">=&quot;ir.ui.view&quot;</span><span style="color:#e8bf6a;">&gt;
</span><span style="color:#e8bf6a;"> &lt;field </span><span style="color:#bababa;">name</span><span style="color:#6a8759;">=&quot;name&quot;</span><span style="color:#e8bf6a;">&gt;</span>Hide Order line for PSS<span style="color:#e8bf6a;">&lt;/field&gt;
</span><span style="color:#e8bf6a;"> &lt;field </span><span style="color:#bababa;">name</span><span style="color:#6a8759;">=&quot;model&quot;</span><span style="color:#e8bf6a;">&gt;</span>sale.order<span style="color:#e8bf6a;">&lt;/field&gt;
</span><span style="color:#e8bf6a;"> &lt;field </span><span style="color:#bababa;">name</span><span style="color:#6a8759;">=&quot;inherit_id&quot; </span><span style="color:#bababa;">ref</span><span style="color:#6a8759;">=&quot;sale.view_order_form&quot;</span><span style="color:#e8bf6a;">/&gt;
</span><span style="color:#e8bf6a;"> &lt;field </span><span style="color:#bababa;">name</span><span style="color:#6a8759;">=&quot;arch&quot; </span><span style="color:#bababa;">type</span><span style="color:#6a8759;">=&quot;xml&quot;</span><span style="color:#e8bf6a;">&gt;
</span><span style="color:#e8bf6a;"> &lt;xpath </span><span style="color:#bababa;">expr</span><span style="color:#6a8759;">=&quot;//page[@name=&apos;order_lines&apos;]&quot; </span><span style="color:#bababa;">position</span><span style="color:#6a8759;">=&quot;attributes&quot;</span><span style="color:#e8bf6a;">&gt;
</span><span style="color:#e8bf6a;"> &lt;t </span><span style="color:#bababa;">groups</span><span style="color:#6a8759;">=&quot;ns_crm.ns_crm_pss_team&quot;</span><span style="color:#e8bf6a;">&gt;
</span><span style="color:#e8bf6a;"> &lt;attribute </span><span style="color:#bababa;">name</span><span style="color:#6a8759;">=&quot;invisible&quot;</span><span style="color:#e8bf6a;">&gt;</span>True<span style="color:#e8bf6a;">&lt;/attribute&gt;
</span><span style="color:#e8bf6a;"> &lt;/t&gt;
</span><span style="color:#e8bf6a;"> &lt;/xpath&gt;
</span><span style="color:#e8bf6a;"> &lt;xpath </span><span style="color:#bababa;">expr</span><span style="color:#6a8759;">=&quot;//page[@name=&apos;customer_signature&apos;]&quot; </span><span style="color:#bababa;">position</span><span style="color:#6a8759;">=&quot;attributes&quot;</span><span style="color:#e8bf6a;">&gt;
</span><span style="color:#e8bf6a;"> &lt;t </span><span style="color:#bababa;">groups</span><span style="color:#6a8759;">=&quot;ns_crm.ns_crm_pss_team&quot;</span><span style="color:#e8bf6a;">&gt;
</span><span style="color:#e8bf6a;"> &lt;attribute </span><span style="color:#bababa;">name</span><span style="color:#6a8759;">=&quot;invisible&quot;</span><span style="color:#e8bf6a;">&gt;</span>True<span style="color:#e8bf6a;">&lt;/attribute&gt;
</span><span style="color:#e8bf6a;"> &lt;/t&gt;
</span><span style="color:#e8bf6a;"> &lt;/xpath&gt;
</span><span style="color:#e8bf6a;"> &lt;/field&gt;
</span><span style="color:#e8bf6a;">&lt;/record&gt;</span></pre>

Rama Altayeb
Autor

Are you sure of the groups' external id "ns_crm.ns_crm_pss_team"?
I can't find the "ns_crm" module

Rama Altayeb
Autor

I tested your code but with a different group external id and its working very well on odoo16

Muhammad Yusuf

I have the same issue it's working if I use field like add a new field inside <t but always working for attribute

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste Antwort

Hi,

You can try like below, in the following code the action_cancel button will replace only for the user with group base.group_no_one

<?xml version="1.0" encoding="utf-8"?>


<odoo>


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


        <field name="name">sale.order.inherit.form.view</field>


        <field name="model">sale.order</field>


        <field name="inherit_id" ref="sale.view_order_form"/>


        <field name="groups_id" eval="[(6,0,[ref('base.group_no_one')])]"/>


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


            <button name="action_cancel" position="replace">


            </button>


        </field>


    </record>


</odoo>


Regards

-6
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
want to find a tiny View to edit with Odoo frontend via Settings...
views odoo16features
Avatar
Avatar
Avatar
2
Aug. 24
5132
User Access in Specific Field
views odoo16features
Avatar
Avatar
Avatar
2
Jan. 24
2711
v16: while Upgrading Module it is showing View related Error Gelöst
views odoo16features
Avatar
Avatar
1
Nov. 23
2948
remove groups_id from view Gelöst
views groups
Avatar
Avatar
1
Juli 19
11500
how to use FIGMA for Odoo to create Forms, Tree and other Views
views odoo16features beautify
Avatar
Avatar
1
Dez. 24
6243
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now