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

How to hide reports from print menu?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
actionreport
4 Odpowiedzi
27945 Widoki
Awatar
Gleb
I'm trying hide two reports, but when i run the code only one (first report) is not displayed. Can you tell me what the problem is?     
@api.model
def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
res = super(AccountInvoice, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar,
submenu=submenu)
report_account_invoice_bill = self.env.ref('l10n_ru_doc.report_account_invoice_bill')
report_account_invoice_act = self.env.ref('l10n_ru_doc.report_account_invoice_act')
for print_submenu in res.get('toolbar', {}).get('print', []):
if print_submenu['id'] == report_account_invoice_bill.id:
res['toolbar']['print'].remove(print_submenu)
if print_submenu['id'] == report_account_invoice_act.id:
res['toolbar']['print'].remove(print_submenu)
return res
Thanks!
1
Awatar
Odrzuć
Gleb
Autor

Solution:

Use two methods

@api.multi

def create_action(self):

""" Create a contextual action for each report. """

for report in self:

model = self.env['ir.model']._get(report.model)

report.write({'binding_model_id': model.id, 'binding_type': 'report'})

return True

@api.multi

def unlink_action(self):

""" Remove the contextual actions created for the reports. """

self.check_access_rights('write', raise_exception=True)

self.filtered('binding_model_id').write({'binding_model_id': False})

return True

Awatar
Belal Salah
Najlepsza odpowiedź

add menu=False to report action

      id="account_invoices"

      model="account.invoice"

      string="Invoices"

      report_type="qweb-pdf"

      name="account.report_invoice_with_payments"

      file="account.report_invoice_with_payments"

      attachment="(object.state in ('open','in_payment','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"

      print_report_name="(object._get_report_base_filename())"

      groups="account.group_account_invoice"

    menu =False

  />

Video: https://www.youtube.com/watch?v=lVMDXpqasic&t=1s

5
Awatar
Odrzuć
Jose David Moreno Hernandez

It works perfectly, thank you!

LaoThai

Great Answer, thank you

M.halim

just Add

menu="False"

Sakthi Priya

how to set menu false based on state

Awatar
Pradip Yenpure (prye)
Najlepsza odpowiedź

If you want to hide the particulate report from the print menu then you can hide using the fields_view_get() function.I  added the below snippet code. This code may help you.

@api.model
def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
    ##Sample Code of Hide print ,action menu and particular report
    res = super().fields_view_get(view_id, view_type, toolbar, submenu)
    remove_report_id = self.env.ref('purchase.report_purchase_quotation').id
    if view_type == 'form' and remove_report_id and \
        toolbar and res['toolbar'] and res['toolbar'].get('print'):
        remove_report_record = [rec for rec in res['toolbar'].get('print') if rec.get('id')==                                 remove_report_id]
        if remove_report_record and remove_report_record[0]:
             res['toolbar'].get('print').remove(remove_report_record[0])
    return res
0
Awatar
Odrzuć
Awatar
Asad Asif
Najlepsza odpowiedź

Hello,
There is an inexpensive app which can allow you to do that:

\https://www.odoo.com/apps/modules/12.0/hide_any_report/​

0
Awatar
Odrzuć
Awatar
Haresh Kansara
Najlepsza odpowiedź

Hi Gleb,

i think you need to first find the report external id defined in XML file and then inherit that XML code and add parameter invisible="1" to that code using xpath.

e.g. i have one report in account module and i want to hide then

<report

      id="account_invoices"

      model="account.invoice"

      string="Invoices"

      report_type="qweb-pdf"

      name="account.report_invoice_with_payments"

      file="account.report_invoice_with_payments"

      attachment="(object.state in ('open','in_payment','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"

      print_report_name="(object._get_report_base_filename())"

      groups="account.group_account_invoice"

  />


Then add invisible parameter like:


<report

      id="account.account_invoices"

      invisible="1"

      model="account.invoice"

      string="Invoices"

      report_type="qweb-pdf"

      name="account.report_invoice_with_payments"

      file="account.report_invoice_with_payments"

      attachment="(object.state in ('open','in_payment','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"

      print_report_name="(object._get_report_base_filename())"

      groups="account.group_account_invoice"

  />

There is one module available to hide print button: https://goo.gl/nuvnmw

Accept and upvote answer if helpful

Thanks and regards

Haresh Kansara

0
Awatar
Odrzuć
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ść
Preview or show a specific report Rozwiązane
action report preview
Awatar
Awatar
Awatar
3
paź 25
1771
Guia Basica ¿Cómo puedo hablar con un asesor de Volaris?
action
Awatar
0
lis 25
2
Need Advice For Migrate Thousands of Messy SKUs
action
Awatar
0
lis 25
8
Pickup Date for E-Commerce Rozwiązane
action
Awatar
Awatar
Awatar
2
lis 25
208
[FAQ's]~Can you book a cruise over the phone?
action
Awatar
0
lis 25
2
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