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

How to open a form view from click on list view?

Abonare

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

Această întrebare a fost marcată
formv7clicktreelist
3 Răspunsuri
25091 Vizualizări
Imagine profil
René Schuster

This question is asked often for tree views, but not for list view.

First some disambiguation:

  • a tree view is a  view with view_type = form and view_mode = tree
  • a list view with view_type = tree

There a some very interessting differences between a list view and a tree view, e.g you can only use the parent-child-structure with list views, but that's not the topic.

For tree views, the solution is quite trivial. If the view_mode contains a form view, then a click on the tree view will automatically open the form view of the clicked record (though I don't know for sure if it's opened in the current or a new window). This is not the case for list views!

Anyway, for some more fancy actions triggered by clicking on a tree/list view, you will need to bind these actions with a ir.values record with key2 = tree_but_open.

When I try to open a form view of the clicked record in a list view it shows the form view, but for a new record. Not the clicked one.

Snippets:

           <record id="open_project_from_hierarchy" model="ir.actions.act_window">
                   <field name="name">Project</field>
                   <field name="res_model">project.project</field>
                   <field name="view_type">form</field>
                   <field name="view_mode">tree,form</field>
                   <field name="view_id" ref="view_project"></field>
                   <field name="search_view_id" ref="view_project_filter"></field>
                   <field name="domain">[('id','=',active_id)]</field>
                   <field name="context">{}</field>  
           </record>
                              
           <record id="ir_open_project_form" model="ir.values">
             <field name="key2" eval="'tree_but_open'"></field>
             <field name="model" eval="'project.project'"></field>
             <field name="name">View project</field>
             <field name="value" eval="'ir.actions.act_window,'+str(open_project_from_hierarchy)"></field>
           </record>            

Note the domain on the bound action.

Any advise? Is it even possible to open the form view of the clicked record in a list view?

 

Thanks.

2
Imagine profil
Abandonează
Sehrish

Open tree view in button click: https://learnopenerp.blogspot.com/2017/10/redirect-to-tree-view-from-button-click.html

Imagine profil
Andre de Kock
Cel mai bun răspuns

You can add the following to the tree view XML:

<button type="object" name="get_formview_action" string="Open" icon="fa-edit"/>
2
Imagine profil
Abandonează
Imagine profil
Shahriar Siddik
Cel mai bun răspuns

René, I also need to open the form view by clicking the hierarchical tree view element. Did you find anything?


1
Imagine profil
Abandonează
Imagine profil
Tony Green
Cel mai bun răspuns

openerp.your_module_name = function(instance) {

var QWeb = openerp.web.qweb;
_t = instance.web._t;

instance.web.TreeView.include({

activate: function(id) {
var self = this;
var result = self._super(id);

if (self.model == 'your.model'){

self.do_action({
type: 'ir.actions.act_window',
res_model: self.model,
view_type: 'form',
view_mode: 'form',
res_id: id,
views: [[false, 'form']],
});
}

return result;
},

});

Try to use this javascript

1
Imagine profil
Abandonează
Maxim Burinov

I could'n make "activate" called on odoo14. It seems they have changes JS API.

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
How to understand view name and model data anywhere in Odoo?
form view graph tree list
Imagine profil
Imagine profil
1
mar. 15
9373
Tree not showing "Add an item"
form tree
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
mai 20
8414
How to make a form more wide?
form v7
Imagine profil
Imagine profil
Imagine profil
3
mar. 15
6773
How to delete the field "State" in partner form?
form v7
Imagine profil
Imagine profil
1
mar. 15
5059
One model, two forms and trees, how to set this up?
developement form tree
Imagine profil
Imagine profil
Imagine profil
3
apr. 24
2782
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