Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Open tree view by default in tree without view_mode form

Naroči se

Get notified when there's activity on this post

This question has been flagged
treetree_view
2 Odgovori
12493 Prikazi
Avatar
Michael Jurke

I specified a tree view and action view to open the tree view for a model. It works as first with the following XML:

```

<record id="my_feature_tree" model="ir.ui.view">
  ...
</record>

<record id="action_my_feature_tree1" model="ir.actions.act_window">
  <field name="name">My Feature</field>
  <field name="res_model">my_module.my_model</field>
  <field name="view_type">form</field>
  <field name="view_mode">tree,kanban,form,pivot,graph</field>
  <field eval="False" name="view_id"/>
  <field name="domain">
    [('agent_id','!=',False)]
  </field>
  <!-- <field name="search_view_id" ref="view_account_invoice_filter"/> -->
</record>

<record id="action_my_feature_tree1_view1" model="ir.actions.act_window.view">
  <field eval="1" name="sequence"/>
  <field name="view_mode">tree</field>
  <field name="view_id" ref="my_feature_tree"/>
  <field name="act_window_id" ref="action_my_feature_tree1"/>
</record>

```

But when I remove the view_mode "form" and set view_type to "tree", the view is broken:

* tree view is missing entirely (only kanban, pivot and graph are available

Is this a bug? This tree view is just a database view and record creations is undesirable. I already added create="false" to the tree element to get rid of the "Create" and "Import" buttons, but still it opens the form when clicking on a line.

It would also solve my problem if I could specify another form view AND model to represent in the form view. But the tree model and the default form view cannot be used.

Thanks a lot!

1
Avatar
Opusti
Avatar
Michael Jurke
Best Answer

I found a workaround by specifying separate views for tree and form.

However, it does not really answer the question, because I did not find a way to disable the form view. It is still a bit confusing for the customer, it would be preferable not to open the form view at all because there are other clickable buttons in the rows. 

But I leave the workaround here for whoever needs it. You can create a custom action and assign custom action views to it like this:

  <record id="action_my_products" model="ir.actions.act_window">
    <field name="name">Products</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">product.product</field>
    <field name="view_mode">tree,form</field>
    <field name="view_id" ref="<tree_view_ref>"/>
  </record>

  <record id="action_my_products_tree" model="ir.actions.act_window.view">
    <field name="view_mode">tree</field>
    <field name="view_id" ref="<tree_view_ref>"/>
    <field name="act_window_id" ref="action_my_products"/>
  </record>

  <record id="action_my_product_form" model="ir.actions.act_window.view">
    <field name="view_mode">form</field>
    <field name="view_id" ref="<form_view_ref>"/>
    <field name="act_window_id" ref="action_my_products"/>
  </record>


0
Avatar
Opusti
Avatar
yasir iqbal
Best Answer

same problem

0
Avatar
Opusti
Michael Jurke

In another, more recent project I used the above workaround with an informational dummy form view. Maybe it helps you, too.

Enjoying the discussion? Don't just read, join in!

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Error while printing a tree: Can't render view base.view_partner_form for model: res.partner
treeview tree tree_view
Avatar
1
apr. 16
4663
Reduced Tree view screen space or multiple trees in single screen
tree tree_but_open tree_view
Avatar
Avatar
1
mar. 15
5048
tree colors in a view contains a statusbar ?? Solved
tree colors tree_view
Avatar
Avatar
1
mar. 15
7032
Show a field from many2many relationship in a tree view Solved
treeview tree many2many tree_view
Avatar
Avatar
Avatar
Avatar
4
jun. 25
12360
Making a tree column invisible depending on the view or model
tree_view
Avatar
Avatar
2
maj 22
4412
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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