Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

[v13] Why can't I xpath to this button ??

Odebírat

Get notified when there's activity on this post

This question has been flagged
buttonssale.order.formxpathOdoo13
2 Odpovědi
7405 Zobrazení
Avatar
Hugo


Hi,


I've tried many different approaches, but I just can't find a way to xpath to these buttons on res.partner.form :



I've used the browsers HTML inspector (F12) to find the name of the buttons, but maybe thats not the correct way


How can I make those buttons visible only to administrators?

My code:

<record id="edit_partner_form" model="ir.ui.view"> 
<field name="name">edit.partner.form</field> 
    <field name="model">res.partner</field> 
    <field name="inherit_id" ref="base.view_partner_form" /> 
    <field name="arch" type="xml"> 

        <xpath expr="//button[@name='action_view_partner_invoices']" position="attributes"> 
            <attribute name="groups">base.group_system</attribute> 
        </xpath>
          <xpath expr="//button[@name='302']" position="attributes">              <attribute name="groups">base.group_system</attribute>          </xpath>      </field> </record>


Edit: Just found out the solution! To anyone who has the same issue in the future, there are 2 external IDs, one for each button:

<record id="edit_sales_hide_invoice_button" model="ir.ui.view">
<field name="name">edit.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.partner_view_buttons" />
<field name="arch" type="xml">

<xpath expr="//button[@name='action_view_partner_invoices']" position="attributes">
<attribute name="groups">base.group_system</attribute>
</xpath>

</field>
</record>
<record id="edit_sales_hide_sale_button" model="ir.ui.view">
<field name="name">edit.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="sale.res_partner_view_buttons" />
<field name="arch" type="xml">

<xpath expr="//button[@name='302']" position="attributes">
<attribute name="groups">base.group_system</attribute>
</xpath>

</field>
</record>


0
Avatar
Zrušit
Avatar
Niyas Raphy (Walnut Software Solutions)
Nejlepší odpověď

Hi,

If the original button is of the type action, in the user interface it will the id of the corresponding action.

Original Button in the code,

<button class="oe_stat_button" type="action" name="%(sale.act_res_partner_2_sale_order)d" 
groups="sales_team.group_sale_salesman"
icon="fa-usd">
<field string="Sales" name="sale_order_count" widget="statinfo"/>
</button>

And if you check the same from the UI, it will be show like this,

<button class="oe_stat_button" type="action" name="354" groups="sales_team.group_sale_salesman" icon="fa-usd">
<field string="Sales" name="sale_order_count" widget="statinfo"/>
</button>

So to inherit this, do like this,

<xpath expr="//button[@name='%(sale.act_res_partner_2_sale_order)d']" position="after">
</xpath>

Thanks

1
Avatar
Zrušit
Hugo
Autor

Thanks Niyas!

Avatar
Lisdrelys Rojas
Nejlepší odpověď

Hello, my code is:

><data>
<recordid="account_view_bank_statement_form_inherit"model="ir.ui.view"><fieldname="name">account.view.bank.statement.form.inheritfield><fieldname="model">account.bank.statementfield><fieldname="inherit_id"ref="account.view_bank_statement_form"/><fieldname="arch"type="xml"><xpathexpr="//button[@name='button_post']"position="attributes"><attributename="groups">restrictions_for_bank_statements_and_reconciliation.group_publicar_extractos_bancariosattribute>xpath><xpathexpr="//button[@name='button_validate_or_action']"position="attributes"><attributename="groups">restrictions_for_bank_statements_and_reconciliation.group_validar_extractos_bancariosattribute>xpath>field>record>
data>odoo>


By it not hide that button, Why?




0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Hide/Show button based on stages in Maintenance Module
buttons xpath odoo11
Avatar
Avatar
2
bře 22
6266
Button disable for logged in users! Vyřešeno
sales portal buttons disable xpath
Avatar
Avatar
1
čvc 25
1219
Error when updating sale after replacing form
form sale sale.order.form xpath form_view
Avatar
2
lis 19
3513
odoo13 report
Odoo13
Avatar
Avatar
1
čvc 25
3345
lock sales confirm
sale.order.form
Avatar
Avatar
1
srp 24
1755
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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