Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

What is wizard ?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
wizard
3 Răspunsuri
34515 Vizualizări
Imagine profil
stephen nedumpally

What is wizard.what are the uses or application with example

5
Imagine profil
Abandonează
Mitul Shingala

hello,

please refer this link, i hope this will helps you.: https://odooforbeginnersblog.wordpress.com/2017/03/05/how-to-create-wizards-in-odoo/

Imagine profil
Abraham Qureshi
Cel mai bun răspuns

please refer these documentation.It will help you

https://www.odoo.com/documentation/12.0/howtos/backend.html#wizards

6
Imagine profil
Abandonează
Imagine profil
Dhaval Desai
Cel mai bun răspuns

Hi, 

Geo,

* Odoo Wizard Document Link Given Below Please refer It will definitely help you. :      https://www.odoo.com/documentation/12.0/howtos/backend.html#wizards

* Wizard Example:

1. Create the Transient Model : I have create a new python file salewiz.py under the models directory. The name of our transient model  is : sale.control.limit.wizard. For now, we won’t bother creating fields for it. Let’s keep it basic.

# -*- coding: utf-8 -*-

from odoo import api, models,fields

from odoo.exceptions import UserError

from odoo import exceptions

import logging

_logger = logging.getLogger(__name__)


class SaleConfirmLimit(models.TransientModel):

_name='sale.control.limit.wizard'

invoice_amount = fields.Float('Invoice Amount',readonly=1)

new_balance = fields.Float('Total Balance',readonly=1)

my_credit_limit = fields.Float('Partner Credit Limit',readonly=1)

@api.multi

def agent_exceed_limit(self):

    _logger.debug(' \n\n \t We can do some actions here\n\n\n')

2. Create the XML view file for the Wizard or popup window

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<record model="ir.ui.view" id="my_credit_limit_wizard">

<field name="name">Confirming Sale Order When Credit is Over Limit</field>

<field name="model">sale.control.limit.wizard</field>

<field name="type">form</field>

<field name="arch" type="xml">

<form>

    <group>

          <span>The following customer is about or exceeded their credit limit. This operation needs an Authorized                         Employee to approve the sale order:</span>

    </group>

    <group>

        <field name="invoice_amount" widget="monetary"/>

        <field name="new_balance" widget="monetary"/>

        <field name="my_credit_limit" widget="monetary"/>

    </group>

    <footer>

        <button string="Cancel" special="cancel" class="oe_highlight"/>

        <button name="agent_exceed_limit" string="Request Manager to Approve Sale" type="object"         class="oe_highlight" />

    </footer>

</form>

</field>

</record>

</odoo>

 3. Update the __manifest__.py file to edit the data attribute

'data': [

'views/partner_credit_view.xml',

'views/wizard.confirm.overcredit.xml',

],

4. We may need to create the view with its parameter values  !

params=order.check_credit_limit()

view_id=self.env['sale.control.limit.wizard']

new = view_id.create(params[0])

#The part of the code to initiate the creation of the wizard is shown below:return {

'type': 'ir.actions.act_window',

'name': 'Warning : Customer is about or exceeded their credit limit',

'res_model': 'sale.control.limit.wizard',

'view_type': 'form',

'view_mode': 'form',

'res_id' : new.id,

'view_id': self.env.ref('control_credit_limit.my_credit_limit_wizard',False).id,

'target': 'new',

}

5. As we have extended the sale.order class and we are to override the action_confirm method, we need to return the object to fire off the popup window as follows !

# -*- coding: utf-8 -*-

from odoo import api, models,fields

class MySale(models.Model):

_inherit = "sale.order"

@api.one

def check_credit_limit(self):

    partner=self.partner_id

    new_balance=self.amount_total+partner.credit

    if new_balance>partner.my_credit_limit:

        params = {'invoice_amount':self.amount_total,'new_balance': new_balance,'my_credit_limit':                             partner.my_credit_limit}

        return params

    else:

        return True

@api.multi

def action_confirm(self):

    for order in self:

        params=order.check_credit_limit()

        view_id=self.env['sale.control.limit.wizard']

        new = view_id.create(params[0])

    return {

                'type': 'ir.actions.act_window',

                'name': 'Warning : Customer is about or exceeded their credit limit',

                'res_model': 'sale.control.limit.wizard',

                'view_type': 'form',

                'view_mode': 'form',

                'res_id' : new.id,

                'view_id': self.env.ref('control_credit_limit.my_credit_limit_wizard',False).id,

                'target': 'new'}

#res = super(MySale, self).action_confirm()

#return res

6. That’s it! we have created a simple wizard popup window.


Thank You.


2
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Load currnet record values when calling wizard Rezolvat
wizard
Imagine profil
Imagine profil
1
dec. 22
4304
Close wizard in onchange
wizard
Imagine profil
Imagine profil
4
iul. 25
5689
IntegrityError: null value in column "res_model" violates not-null constraint Rezolvat
wizard
Imagine profil
Imagine profil
2
dec. 23
18684
populate wizard form dynamically Rezolvat
wizard
Imagine profil
Imagine profil
Imagine profil
Imagine profil
6
apr. 18
22440
How To call wizard from python in odoo10 Rezolvat
wizard
Imagine profil
Imagine profil
5
dec. 23
19109
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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