Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

How to add a field to a wizard?

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
wizardinheritedit
1 Rispondi
11383 Visualizzazioni
Avatar
Juan Formoso Vasco

I am trying to add a field (only a checkbox) to a wizard. I managed to do exactly this with other form, but it was not a wizard. But I repeated the same steps (obviously changing the respective names and variables) and I cannot see my field in the wizard. I inherited the original wizard as I did with the form which worked, but I do not know if I am doing something stupid, because I have just arrived to OpenERP a few time ago.

The structure of my module is:

my_module
|__ wizard
|   |__ __init__.py
|   |__ wizard_print.py
|
|__ __init__.py
|__ __openerp__.py
|__ my_module_wizard.xml

And my two important files are:

wizard_print.py (in a folder called wizard which has its respective __init__.py too)

from osv import fields, osv

class print_wizard(osv.osv_memory):

    _name = 'my.module.print.wizard'
    _inherit = 'original.module.print.wizard'
    
    _columns = {
        'dummy': fields.boolean('My dummy'),
    }
    _defaults = {
         'dummy': True,
     }

print_wizard()

my_module_wizard.xml (in the main folder with the __openerp__.py and __init__.py)

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record model="ir.ui.view" id="wizard_my_module_print">
            <field name="name">my.module.print.wizard.form</field>
            <field name="model">my.module.print.wizard</field>
            <field name="inherit_id" ref="original_module.wizard_original_module_print"/>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <xpath expr="/form/field[@name='original_variable']" position="after">
                    <newline/>
                    <field name="dummy"/>
                    <newline/>
                </xpath>
            </field>
         </record>
    </data>
</openerp>

Is this structure right? Should it work or is there any mistake I do not know?

0
Avatar
Abbandona
Juan Formoso Vasco
Autore

Thank you @René Schuster! I removed both: _name from the python declaration and from the XML view. But it does not work yet.

Juan Formoso Vasco
Autore

Ok I did not have to delete the field in the XML view! In the XML view I had to change the content of the tag : replace my.module.print.wizard by original.module.print.wizard. I had understood you wrong!

Avatar
René Schuster
Risposta migliore

If you inherit from an existing model and set a different _name value, an new model will be created.

I think that is not quite what you want.

Change the _name value to "original.module.print.wizard" (in the python declaration and the xml view).

For more information see the Technical Mementos section on different inheritance mechanisms: https://www.odoo.com/files/memento/OpenERP_Technical_Memento_latest.pdf

Or this: http://stackoverflow.com/questions/21111627/inheritance-of-customized-module-in-openerp

 

Regards.

2
Avatar
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
How to hide edit button in inherited view with condition
hide inherit edit xpath
Avatar
0
nov 15
6170
creating a new module
module inherit constraint edit
Avatar
Avatar
1
mar 15
5830
How to do Prototpye inherit in odoo
inherit
Avatar
Avatar
Avatar
Avatar
Avatar
4
mar 24
4487
Inheritance for account.financial.report model?
inherit
Avatar
Avatar
1
ott 23
6448
I can't inherit a wizard (Odoo v16) Risolto
wizard models inherit transientmodel odoo16features
Avatar
Avatar
Avatar
Avatar
3
set 23
4355
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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