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í
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Kov
    • Nábytek
    • Jídlo
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • IT hardware a podpora
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • 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

Remove button when inherit a view

Odebírat

Get notified when there's activity on this post

This question has been flagged
inheritancebuttonsremoveodooV8
1 Odpovědět
20135 Zobrazení
Avatar
Francisco Castro

Hey

I have a problem that I cant resolve

I want to remove the button "Imprimir" (Print) on the sale orders I just did all like

<xpath expr="//button[@name='invoice_print']" position="replace">
                 <!--add sometihng-->

</xpath>

or

<button name="invoice_print" string="Print" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user" position="replace">
                  <!--add something-->

</button>

or 

 <xpath expr="//button[@name='invoice_print']" position="attributes">
                <attribute name="invisible">1</attribute>
              </xpath>

And none of those remove the button....

What I did wrong?

 

Best Regards

 

my code is this 

<record model="ir.ui.view" id="account_invoice_rule_saft_inherit">
            <field name="name">account.invoice.rule.saft.inherit</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_form"/>
            <field name="arch" type="xml">
        <header>
              <!--<button name="invoice_print" string="Print" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user" position="replace">
                  
              </button>-->
              <!--<xpath expr="//button[@name='invoice_print']" position="attributes">
                <attribute name="invisible">1</attribute>
              </xpath>-->
              <xpath expr="//button[@name='invoice_print'][0]" position="attributes">
                <attribute name="invisible">True</attribute>
              </xpath>
              <xpath expr="//button[@name='invoice_print'][1]" position="attributes">
                <attribute name="invisible">True</attribute>
              </xpath>

                 <button name="print_original" type="object" string="Original" attrs="{'invisible':['|','|',('impressoori', '=', True),('impressoall', '=', True),('state','=','draft')]}"/>

                <button name="print_duplicado" type="object" string="Duplicado" attrs="{'invisible':['|','|',('impressodupl', '=', True),('impressoall', '=', True),('state','=','draft')]}"/>  

                <button name="print_triplicado" type="object" string="Triplicado" attrs="{'invisible':['|','|',('impressoall','=',True),('impressotri','=',True),('state','=','draft')]}"/>

                <button name="print_all" type="object" string="Todas as Vias" attrs="{'invisible':['|','|','|','|',('impressoall', '=', True),('impressoori', '=', True),('impressodupl', '=', True),('impressotri', '=', True),('state','=','draft')]}" />

                <button name="print_segunda_via" type="object" string="Segunda Via" attrs="{'invisible':['|',('impressoseg', '=', True),('state','=','draft')]}" />
                
            </header>
        <notebook colspan="4" position="after">
            
        <group col="1">
                <field name="impressodupl" nolabel="0" invisible="1" />
                <field name="impressoori" nolabel="0" invisible="1" />
                <field name="impressotri" nolabel="0" invisible="1" />
                <field name="impressoall" nolabel="0" invisible="1" />
          <field name="impressoseg" nolabel="0" invisible="1" />
          
        </group>
           
          </notebook>
               </field>
        </record>

0
Avatar
Zrušit
Francisco Castro
Autor

hum... didnt work my xml code is: account.invoice.rule.saft.inherit account.invoice account.invoice.rule.saft.inherit account.invoice

<xpath expr="//button[@name='invoice_print']" position="replace"/> <xpath expr="//button[@name='invoice_print']" position="replace"/>

Avatar
Atchuthan - Technical Consultant, Sodexis Inc
Nejlepší odpověď

FIRST, your FORM inheritance is wrong.  

Since there are 2 buttons available at Account Invoice Form https://github.com/odoo/odoo/blob/8.0/addons/account/account_invoice_view.xml#L297

METHOD-1:
So replace button twice in your inherited view.
<record id="account_invoice_form_inherit" model="ir.ui.view">
    <field name="name">account.invoice.form.sciencefirst</field>
    <field name="model">account.invoice</field>
    <field name="inherit_id" ref="account.invoice_form"/>
    <field name="arch" type="xml">
        <xpath expr="//button[@name='invoice_print']" position="replace"/>
        <xpath expr="//button[@name='invoice_print']" position="replace"/>

    </field>
</record>

METHOD-2:
<record id="account_invoice_form_inherit" model="ir.ui.view">
    <field name="name">account.invoice.form.sciencefirst</field>
    <field name="model">account.invoice</field>
    <field name="inherit_id" ref="account.invoice_form"/>
    <field name="arch" type="xml">
</record>
<xpath expr="//button[@name='invoice_print'][1]" position="attributes">
    <attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//button[@name='invoice_print'][2]" position="attributes">
    <attribute name="invisible">True</attribute>
</xpath>

    </field>
 

6
Avatar
Zrušit
Francisco Castro
Autor

the First one dindt do nothing the second one it appears two labels on the Header "True" "True" the button Print is on the same place it just added two new fields on the header

Atchuthan - Technical Consultant, Sodexis Inc

Sorry, I provided code for Account Invoice instead of Sales order. I have corrected the code. Please check it.

Francisco Castro
Autor

but I think my question is on the account invoice

Atchuthan - Technical Consultant, Sodexis Inc

please provide correct description "I want to remove the button "Imprimir" (Print) on the sale orders I just did all like"??

Francisco Castro
Autor

I just try all I know and then I said my tries :) sorry

Atchuthan - Technical Consultant, Sodexis Inc

no problem

Francisco Castro
Autor

ok I did the 1st method and it worked thx for the pacience :)

Francisco Castro
Autor

patience*

Ankit H Gandhi(AHG)

Thanks, Atchuthan

+1

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
How to pass data from a class to another Vyřešeno
inheritance odooV8
Avatar
Avatar
Avatar
Avatar
Avatar
8
srp 15
17469
How update field value on button click using odoo v8 . Vyřešeno
buttons odooV8
Avatar
Avatar
1
bře 15
8954
Odoo 8 view inheritance problem
inheritance odooV8
Avatar
Avatar
1
bře 15
3861
How to add field into product.template model form view's Purchase tab line? Vyřešeno
sales inheritance odooV8
Avatar
Avatar
Avatar
2
čvc 25
2293
Remove Powered by Odoo from Website footer. Instructions. Enjoy. Vyřešeno
remove odoo odooV8
Avatar
Avatar
Avatar
Avatar
Avatar
14
led 25
127595
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