Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to add a group to inherited view odoo16

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
viewsgroupsodoo16features
3 Antwoorden
15909 Weergaven
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
Annuleer
Avatar
Rama Altayeb
Auteur Beste antwoord

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
Annuleer
Globalist Technology

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

Avatar
AKRAM
Beste antwoord

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
Annuleer
Rama Altayeb
Auteur

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
Auteur

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

Rama Altayeb
Auteur

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 antwoord

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
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
want to find a tiny View to edit with Odoo frontend via Settings...
views odoo16features
Avatar
Avatar
Avatar
2
aug. 24
5134
User Access in Specific Field
views odoo16features
Avatar
Avatar
Avatar
2
jan. 24
2715
v16: while Upgrading Module it is showing View related Error Opgelost
views odoo16features
Avatar
Avatar
1
nov. 23
2951
remove groups_id from view Opgelost
views groups
Avatar
Avatar
1
jul. 19
11502
how to use FIGMA for Odoo to create Forms, Tree and other Views
views odoo16features beautify
Avatar
Avatar
1
dec. 24
6249
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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