Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Odoo 8: how to prevent wizard from closing after a new one is opened?

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
wizardpython2.7odoo8
2 Besvarelser
6906 Visninger
Avatar
SlyK

I am trying to create a wizard, launched from a button in res.partner's form view, which has two buttons on its footer (besides the 'cancel' one): the first one launches a method that does stuff inside the related res.partner record (but it's not important to the main problem); the second one opens the email form with precompiled values (again, from the related res.partner's recordset values).

My question is: how do I prevent the wizard from closing when I click on the "Send email" button which opens the email form, so that (after I've finished with email itself) I can go back to the wizard and click the "Execute action" button?


I am using Odoo 8 with Python 2.7.14.


My code:

1- the button that launches the wizard (from res.partner):

    <button string="Execute action" type="action"
        name="%(execute_action_wizard)d"
        attrs="{'invisible': [('action_required', '=', False)]}"
        class="oe_highlight"/>


2- the action that launches the wizard:

    <record id="execute_action_wizard" 
        model="ir.actions.act_window">
        <field name="name">Execute action</field>
        <field name="res_model">
            account.payment.action.wizard</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" 
            ref="execute_action_wizard_form_view"/>
        <field name="target">new</field>
    </record>


3- the buttons within the wizard itself:

    <button name="compute_execute_action"
        string="Execute action"
        class="oe_highlight"
        type="object"/>
    <button name="open_form_send_mail"
        string="Send email"
        class="oe_highlight"
        type="object"
        attrs="{'invisible':[('send_mail', '=', False)]}"/>


4- email form method: 

    @api.multi
    def open_form_send_mail(self):
        self.ensure_one()
        template_id = self.email_template_id.id
        partner_id = self._context['active_ids'][0]
        compose_form_id = self.env.ref(
            'mail.email_compose_message_wizard_form', False).id
        ctx = dict(
            default_res_id=partner_id,
            default_use_template=True,
            default_template_id=template_id or False,
            default_composition_mode='comment',
            default_model='res.partner',
            default_partner_ids=[(6, 0, [partner_id])],
            default_subject=_(u"Client email")
            )
        return {
            'name': _('Compose Email'),
            'context': ctx,
            'type': 'ir.actions.act_window',
            'target': 'new',
            'res_model': 'mail.compose.message',
            'views': [(compose_form_id, 'form')],
            'view_id': compose_form_id,
            'view_mode': 'form',
            'view_type': 'form',
            'flags': {'action_buttons': True},
        }


Please help me out. This is driving me crazy.

0
Avatar
Kassér
Avatar
Khubab Shams
Bedste svar

you can open just one form as a pop up, just change the first form action target to "current", it will be still open if another form popped up.

<record id="execute_action_wizard" 
        model="ir.actions.act_window">
        <field name="name">Execute action</field>
        <field name="res_model">
            account.payment.action.wizard</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" 
            ref="execute_action_wizard_form_view"/>
        <field name="target">current</field>
    </record>

0
Avatar
Kassér
Avatar
Rakesh Vadeghar
Bedste svar

instead opening a wizard (form view) try to open form view directly


inXML
<button string="Execute action" name="execute_action_wizard" attrs="{'invisible': [('action_required', '=', False)]}"
        class="oe_highlight"/>
def execute_action_wizard(self):
view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'execute_action_wizard')
return {
'name': _('form name'),
'view_type': 'form',
'view_mode': 'form',
'view_id': [view_id],
'res_model': 'res.partner',
'type': 'ir.actions.act_window',
'nodestroy': True,
'target': 'current',
'res_id': self._ids,
}

0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Pivot view does not display in odoo 8 Løst
python2.7 odoo8
Avatar
Avatar
1
okt. 22
6207
How to call wizard in create method in odoo-11 ?
wizard python2.7 odoo11
Avatar
Avatar
1
aug. 20
9530
How to create a recursive function in Python to create a dict which maps Odoo 8 relational field records?
python2.7 recursion dictionary odoo8
Avatar
Avatar
1
jan. 18
16346
Launch wizard after selecting elements in treeView
wizard listview launch odoo8
Avatar
Avatar
1
sep. 17
6537
Odoo 8 - wizard cannot sent back editable input after submit
wizard odooV8 odoo8.0 odoo8
Avatar
1
jan. 17
4308
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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