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
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • 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
    Iní
    • 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
  • Pomoc

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

Error while trying to display a model's tree view

Odoberať

Get notified when there's activity on this post

This question has been flagged
actiontreeviewact_window
1 Odpoveď
8373 Zobrazenia
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
Zrušiť
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
Zrušiť
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
Identical trees in an action window
treeview act_window v14
Avatar
Avatar
1
aug 23
2443
[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
5801
Bulk update in the tree view through user interaction Solved
action treeview routing Manufacturing Order
Avatar
Avatar
Avatar
Avatar
3
dec 21
8532
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