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

[Odoo 10] How to link form view to tree view?

Iscriviti

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

La domanda è stata contrassegnata
viewsxmlcustomodoo10
7 Risposte
14804 Visualizzazioni
Avatar
FEDERICO LEONI

Custom module, object with a tree and a form view linked on menu. 

<odoo>
<record id = "adm_sessions_tree_view" model = "ir.ui.view">
<field name = "name">adm.session.tree</field>
<field name = "model">pos.adm</field>
<field name = "arch" type = "xml">
<tree string = "Session Adm" create = 'false'>
<field name = "day_local"/>
<field name = "pos_ref"/>
<field name = "day_static"/>
<field name = "day_margin"/>
<field name = "day_sold"/>
<field name = "day_costs"/>
<field name = "month_margin"/>
<field name = "month_sold"/>
<field name = "month_costs"/>
<field name = "avg_minutes"/>
</tree>
</field>
</record>

<record id = "adm_sessions_form_view" model = "ir.ui.view">
<field name = "name">adm.session.form</field>
<field name = "model">pos.adm</field>
<field name = "arch" type = "xml">
<form>
<sheet>
<group colspan='4'>
<field name = "day_local"/>
<field name = "pos_ref"/>
<field name = "day_static"/>
<field name = "day_margin"/>
<field name = "day_sold"/>
<field name = "day_costs"/>
<field name = "month_margin"/>
<field name = "month_sold"/>
<field name = "month_costs"/>
<field name = "avg_minutes"/>
</group>
</sheet>
</form>
</field>
</record>


<record id = "adm_sessions_tree_view2" model = "ir.actions.act_window">
<field name = "name">AdM sessions</field>
<field name = "type">ir.actions.act_window</field>
<field name = "res_model">pos.adm</field>
<field name = "view_type">form</field>
<field name = "view_mode">tree, form</field>
<field name = "view_id" ref= "adm_sessions_form_view"/>
</record>


<record id = "adm_sessions_tree_view3" model = "ir.actions.act_window">
<field name = "name">AdM sessions</field>
<field name = "type">ir.actions.act_window</field>
<field name = "res_model">pos.adm</field>
<field name = "view_type">form</field>
<field name = "view_mode">tree, form</field>
<field name = "view_id" eval="False"/>
</record>

<menuitem
action = "adm_sessions_tree_view2"
id = "adm_session_menu"
parent = "pos_divina_custom.menu_point_of_sale2"
name = "Adm Sessions"
sequence= "12"/>
</odoo>

Tree view is correctly loaded and linked to my menu but clicking on record doesn't open the respective form.

I don't need to edit the form, but just show all the other fields (even if now are the same shown on tree).

What are the missing bits?

0
Avatar
Abbandona
Sehrish

How to create Form and Tree view in Odoo: http://learnopenerp.blogspot.com/2016/09/how-to-create-form-and-tree-view-in-odoo.html

Avatar
FEDERICO LEONI
Autore Risposta migliore

Solved adding the line

<field name = "view_id" eval="False"/>

on the tree view (was missing) and after correcting the typo on

<field name = "view_mode">tree,form</field>

(view,form without space as pointed out by Cybrosys). 

0
Avatar
Abbandona
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Risposta migliore

Hi,

Remove the extra space you have added in front of the form in the below line,

       <field name = "view_mode">tree, form</field>


See Updated code,


<record id = "adm_sessions_tree_view2" model = "ir.actions.act_window">
<field name = "name">AdM sessions</field>
<field name = "type">ir.actions.act_window</field>
<field name = "res_model">pos.adm</field>
<field name = "view_type">form</field>
<field name = "view_mode">tree,form</field>
<field name = "view_id" ref= "adm_sessions_tree_view"/>
</record>


Thanks

1
Avatar
Abbandona
FEDERICO LEONI
Autore

indeed the space was a typo, thanks to point it out. Anyway updating with your code generates just an empty form in edit mode.

FEDERICO LEONI
Autore

Found the issue, on the tree view the line

<field name = "view_id" eval="False"/>

is missing. With it the form model open just fine.

Avatar
Mitul Shingala
Risposta migliore

Hello

you have to add the actions like below code. for your reference, in odoo same example is available for the Customer Invoice menu and Vendor Bills.

for example.

        <record id="action_invoice_tree_view1" model="ir.actions.act_window.view">
            <field eval="1" name="sequence"/>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="adm_sessions_tree_view"/>
            <field name="act_window_id" ref="adm_sessions_tree_view2"/>
        </record>
        <record id="action_invoice_form_view1" model="ir.actions.act_window.view">
            <field eval="2" name="sequence"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="adm_sessions_form_view"/>
            <field name="act_window_id" ref="adm_sessions_tree_view2"/>
        </record>


1
Avatar
Abbandona
FEDERICO LEONI
Autore

Thanks, but was just an error on my code.

Avatar
Dhaval Desai
Risposta migliore

Hello

you have to add the below highlights in actions.

for ex.

        <record id = "adm_sessions_tree_view2" model = "ir.actions.act_window">
           <field name = "name">AdM sessions</field>
<field name = "type">ir.actions.act_window</field>
<field name = "res_model">pos.adm</field>
<field name = "view_type">form</field>
<field name = "view_mode">tree,form</field>
<field name = "view_id" ref= "adm_sessions_tree_view"/>
</record>

0
Avatar
Abbandona
FEDERICO LEONI
Autore

The issue was already solved.

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à
[Odoo 10] what is the best way to duplicate an existing view? Risolto
views xml odoo10
Avatar
Avatar
Avatar
2
nov 23
8320
Unable to add 'name' field in a custom module view
views custom odoo10
Avatar
0
mar 17
4781
ODOO10: Operator Or in View XML Risolto
views domain xml odoo10
Avatar
Avatar
4
ott 17
10909
Inherit from inherited view Risolto
views xml
Avatar
Avatar
5
giu 20
7690
How to add custom css class to view for certain group by inheriting it?
views custom group css odoo10
Avatar
0
dic 19
5256
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