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
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • 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
    Procházet všechna odvětví
  • 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
    • Služby pro partnery
    • 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

Close wizard after print report

Odebírat

Get notified when there's activity on this post

This question has been flagged
wizardreportodooV8
3 Odpovědi
13536 Zobrazení
Avatar
ASP

Hi All,

In my project there's a requirement to cut check in batch and print reports in a single click by selecting the list of open supplier invoices. To achieve this I've prepared a wizard and added an option called 'Write check in batch' under 'more' button of the invoice tree view.

 When I select a list of open invoices and choose the above option, a wizard appears for check number entry and it has 2 buttons: 

1. Confirm, 2.Cancel. When user enters the check number and click on confirm it is creating voucher record and validating it as well. Also I'm getting the PDF report instantly as I'm returning a report action at the end of the function.


But my issue is the wizard is not closing and still remains open even after report generation. The Confirm button on the wizard is of type object and I've defined a corresponding method for it where at the end I'm using this:


return self.pool['report'].get_action(cr, uid, [], 'model.report', contect=context) - which generated the PDF.


But my wizard is not closing. Please help me on this. Any help would be appreciated :)


Regards

ASP 

1
Avatar
Zrušit
Michael Goetz-Schneider

Hi ASP, I see just a typo contect=context, but this may be just copy and paste error. We made a generic print wizard initiated by a button, to be able to send the document to a server printer using base_report_to_printer from a third party named Agile. In Version 7 everything works fine, after printing a preview, i.e. PDF as usual, the wizard closes, in Version 8 it does not. Your project may differ from ours, but it is the same issue. Could you solve your problem meanwhile ?

Anabela Damas

Did you find the solution?

Avatar
Nejlepší odpověď

Hi !

Maybe late but solution is to remove report_type key of the resulting dict.

Example:

action_dict = self.env['report'].get_action('xml_id_of_report')
del action_dict['report_type']
return action_dict

or instead of using the get_action method, you can return this

return {'type': ir.actions.report.xml', 'report_name':'xml_id_of_report'}

Hope this help

1
Avatar
Zrušit
Deepa Venkatesh

First option worked liked a charm, though second option didn't work for me. Still good solution, earned a point from me :).. ThankQ...

Deepa Venkatesh

However this fails to load the Qweb format.

@deep maybe your Qweb report has an error because I already launch a Qweb-pdf report successfully with this piece of code

Avatar
Pouya Malekinejad
Nejlepší odpověď

in your report action add this:
{
'close_on_report_download':True
}

Example:

def action_confirm(self):   
    vouchers=self.create_vouchers()
r\eport_action=self.env.ref('your_module.your_report_action').report_action(self.ids_to_print)
    report_action['close_on_report_download']=True
    return report_action

and in your form view :
<footer>
<button string="Confirm" class="btn-primary" type="object" name="action_confirm"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>


0
Avatar
Zrušit
Aïmane

Works in odoo 12, thank you very much.
Where have you found that, is it in a documentation ?

Pouya Malekinejad

No it is not in documentation nor it is used anywhere in Odoo, I needed it and I was looking where to add it and it was already there!

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

Hello,

In your case consider the following example

report_reference = self.env.ref('your_module_name.your_report_action_id').report_action(self, data=datas, config=False)
report_reference.update({'close_on_report_download': True})
return report_reference

It will close the wizard after downloading the report

Regards

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
Generate Report excel from Custom Wizard in Odoo8 ?
wizard report excel odooV8
Avatar
0
dub 18
7084
Change PDF report name on wizard
wizard report
Avatar
Avatar
2
čvc 24
4126
Blank report PDF from Wizard Vyřešeno
wizard report
Avatar
Avatar
2
dub 24
3655
External ID not found in the system
wizard report
Avatar
4
říj 20
6586
how can i add default image to wizard?? Vyřešeno
wizard odooV8
Avatar
Avatar
Avatar
Avatar
3
čvn 19
6032
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