Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Open tree view by default in tree without view_mode form

Odoberať

Get notified when there's activity on this post

This question has been flagged
treetree_view
2 Replies
12471 Zobrazenia
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
Zrušiť
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
Zrušiť
Avatar
yasir iqbal
Best Answer

same problem

0
Avatar
Zrušiť
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!

Registrácia
Related Posts Replies Zobrazenia Aktivita
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
4655
Reduced Tree view screen space or multiple trees in single screen
tree tree_but_open tree_view
Avatar
Avatar
1
mar 15
5025
tree colors in a view contains a statusbar ?? Solved
tree colors tree_view
Avatar
Avatar
1
mar 15
7018
Show a field from many2many relationship in a tree view Solved
treeview tree many2many tree_view
Avatar
Avatar
Avatar
Avatar
4
jún 25
12343
Making a tree column invisible depending on the view or model
tree_view
Avatar
Avatar
2
máj 22
4402
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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