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č

Error while trying to display a model's tree view

Naroči se

Get notified when there's activity on this post

This question has been flagged
actiontreeviewact_window
1 Odgovori
8377 Prikazi
Avatar
arthur

Hello, I am trying to create a new model and display a tree view for its records. Right now I am creating a simple hello world, but am having some problems.

My Module's python code is the following:

class SubscriptionBasket(models.Model):
    _name="subscription.basket"

    test1 = fields.Char("test 1", default = "Hello")
    test2 = fields.Char("test 2", default = "World")

And the model's view is:

<?xml version="1.0" encoding="UTF-8"?>
<odoo>

    <record id="subscription_basket_tree_view" model="ir.ui.view">
        <field name="name">subscription.basket.tree</field>
        <field name="model">subscription.basket</field>
        <field name="arch" type="xml">
            <tree string="Test">
                <field name="test1"/>
                <field name="test2"/>
            </tree>
        </field>
    </record>

    <record id="action_show_subscription_basket_tree" model="ir.actions.act_window">
        <field name="name">Items de Cesta</field>
        <field name="res_model">subscription.basket</field>
        <field name="view_type">tree</field>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="subscription_basket_tree_view"/>
        <field name="target">current</field>
    </record>

    <menuitem
        id="subscription_basket_menuitem"
        action="action_show_subscription_basket_tree"
        name="Itens de Cesta"
        parent="stock.menu_stock_root"
        sequence="100"
    />
</odoo>


The menu item with the label "Itens de Cesta" was displayed on the stock module, just as I wanted, but when I click it, expecting to load the model's tree view, I get the following error:

Error:

Uncaught TypeError: Cannot read property 'type' of undefined

http://localhost:8069/web/content/13020-f14d50c/web.assets_backend.js:478

Traceback:

TypeError: Cannot read property 'type' of undefined

    at Class.get_default_view [as _super] (http://localhost:8069/web/content/13020-f14d50c/web.assets_backend.js:478:432)

    at Class.get_default_view (http://localhost:8069/web/content/13020-f14d50c/web.assets_backend.js:2192:227)

    at Class.get_default_view (http://localhost:8069/web/content/12996-d7813a7/web.assets_common.js:3819:371)

    at Class.init (http://localhost:8069/web/content/13020-f14d50c/web.assets_backend.js:472:752)

    at Class.prototype.(anonymous function) [as init] (http://localhost:8069/web/content/12996-d7813a7/web.assets_common.js:3816:488)

    at new Class (http://localhost:8069/web/content/12996-d7813a7/web.assets_common.js:3817:65)

    at Object.widget (http://localhost:8069/web/content/13020-f14d50c/web.assets_backend.js:451:80)

    at http://localhost:8069/web/content/13020-f14d50c/web.assets_backend.js:449:219

    at http://localhost:8069/web/content/12996-d7813a7/web.assets_common.js:802:681

    at fire (http://localhost:8069/web/content/12996-d7813a7/web.assets_common.js:796:299)


Can anyone point out what I am missing here?

Thank you!

0
Avatar
Opusti
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

Please update the record with id action_show_subscription_basket_tree,

<record id="action_show_subscription_basket_tree" model="ir.actions.act_window">
<field name="name">Items de Cesta</field>
<field name="res_model">subscription.basket</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="subscription_basket_tree_view"/>
</record>

Thanks

1
Avatar
Opusti
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
Identical trees in an action window
treeview act_window v14
Avatar
Avatar
1
avg. 23
2445
[11.0] Perform actions for multiples sales.
action sales act_window
Avatar
Avatar
Avatar
3
jan. 19
4456
Why this action menu voice appears only in the sale order view? Solved
action treeview odoo11
Avatar
Avatar
1
nov. 18
5352
[odoo-13]: How can i create new Action Drop-down in tree view Solved
action treeview drop_down Odoo13.0
Avatar
Avatar
2
dec. 22
5803
Bulk update in the tree view through user interaction Solved
action treeview routing Manufacturing Order
Avatar
Avatar
Avatar
Avatar
3
dec. 21
8532
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