Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

[v 14] Hide Smart buttons in contact form (res.partner)

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
res.partnerhidev14smartbuttonextended
3 Odpowiedzi
4805 Widoki
Awatar
Walter Gabriele

I am trying to hide the smart buttons in the upper right of res.partner, I have succeeded for two of these, but for others it reports me an error like The element

xpath expr = "// form // sheet // div [1] // button [@ name = '641'] "

 />cannot be located in the parent view

this is my code:

i can't attach my code why?

i'm try to explain more:

    this is my inherited view from model res.partner with inerit_id and ref as base. view_partner_form


my xpath call is to form-sheet-div[1]-button[1] - this work

my second xpath call is to button[@name='action_view_partner_invoices' - this work

my other xpath like form - sheet - div[1] - button[@name='%(purchase.act_res_partner_2_purchase_order)d'] - not work

thanks.  

0
Awatar
Odrzuć
Awatar
Waleed Ali Mohsen
Najlepsza odpowiedź

Hi,

If you want to hide all smart button in the res.partner form you can add invisible attribute to div with name "oe_button_box".

To hide purchase Order button:

<record id="res_partner_view_purchase_buttons_inherit" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>


1
Awatar
Odrzuć
Waleed Ali Mohsen

To hide purchase order button use the below:

<record id="res_partner_view_purchase_buttons_inherit" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>

Awatar
Jainesh Shah(Aktiv Software)
Najlepsza odpowiedź

Hello Walter Gabriele,

It is wrong xpath “button[@name='%(purchase.act_res_partner_2_purchase_order)d']”

You can use attributes in XML and give d-none class.

Inherit “res_partner_view_purchase_buttons” from view then try to this xpath


Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

0
Awatar
Odrzuć
Jainesh Shah(Aktiv Software)

Inherit “res_partner_view_purchase_buttons” from view then try to this xpath
<xpath expr=”//div[@name=”button_box]/button” position=”attributes”>
<attribute name="class" add="d-none" separator=" "/>
</xpath>

Awatar
Walter Gabriele
Autor Najlepsza odpowiedź

Thank for your answer Waleed Mohsen but i don't wont hide all because the buttons I want to add to view would also be hidden

0
Awatar
Odrzuć
Walter Gabriele
Autor

hi Jainesh,
maibe something wrong?
<record id="res_partner_view_purchase_buttons_inherited" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherited</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons" />
<field name="arch" type="xml">
<xpath expr="//div[@name=”button_box]/button" position="attributes">
<attribute name="class" add="d-none" separator=""/>
</xpath>
</field>
</record>

Walter Gabriele
Autor

thank you Waleed Mohsen i've tried many of this but this is the error when i update my module:
the field "purchase_order_count" not exist in model "res.partner"

I don't know what I can think anymore.

Walter Gabriele
Autor

<record id="res_partner_view_purchase_buttons_inherit" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/>
<field name="arch" type="xml">
<!-- <xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes">-->
<!-- <attribute name="invisible">1</attribute>-->
<!-- </xpath>-->
<xpath expr="//div[@name='button_box']/button" position="attributes">
<attribute name="class" add="d-none" separator=" "/>
</xpath>
</field>
</record>

same result alwais

Waleed Ali Mohsen

I have tested the below code locally and it's working without any issue.

<record id="res_partner_view_purchase_buttons_inherit" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>

Walter Gabriele
Autor

HI Waleed Mohsen, i don't know why, your suggestion works it's ok so +1, but i had to fix my python code in custom model like this for it to work:

class PartnerInherit ( models.Model ):
_inherit = 'res.partner'
purchase_order_count = fields.Integer(store=False)
purchase_warn = fields.Char(store=False)
purchase_warn_msg = fields.Text(store=False)
on_time_rate = fields.Float(store=False)
sale_order_count = fields.Integer(store=False)
sale_warn = fields.Char(store=False)
sale_warn_msg = fields.Char(store=False)
supplier_invoice_count = fields.Integer(store=False)

Thanks for your support.

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
How to hide customers from sales persons in Odoo 14 Rozwiązane
res.partner v14
Awatar
Awatar
1
maj 22
4346
ver.14: category_id in res.partner - confusing or something wrong Rozwiązane
res.partner v14
Awatar
Awatar
1
mar 21
6560
Odoo 14: res.partner.category __ name of view (xml) file and act window entry to call from custom menu.
res.partner v14
Awatar
0
sty 21
3681
customer field removed on res.partner when upgrading from odoo 12 to 14 Rozwiązane
res.partner odoo12 v14
Awatar
Awatar
1
kwi 23
3481
Access 'other' address country code
res.partner v14 clients
Awatar
0
wrz 22
3052
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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