Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

TypeError: Cannot read properties of undefined (reading 'type')

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
posjsv15
3 Replies
17445 Rodiniai
Portretas
Kahina

I'm encountering a persistent issue when trying to access the Point of Sale (POS) menu in Odoo, and I'm hoping someone can provide guidance on resolving it.


Here's the error message I'm encountering:

TypeError: Cannot read properties of undefined (reading 'type')
    at ControlPanelModelExtension._extractAttributes (http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:3583:107)
    at http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:3565:6
    at Array.forEach ()
    at ControlPanelModelExtension._createGroupOfFiltersFromArch (http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:3560:364)
    at ControlPanelModelExtension._addFilters (http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:3549:51)
    at ControlPanelModelExtension.prepareState (http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:3523:149)
    at ControlPanelModelExtension.importState (http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:5799:68)
    at ActionModel.importState (http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:5815:180)
    at new Model (http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:5804:6)
    at new ActionModel (http://localhost:5050/web/assets/490-44ec158/web.assets_backend.min.js:4460:1)

 I've attempted creating new databases, but the the problem persists, and it consistently arises after installing a custom module. Importantly, this module is unrelated to the POS module, and it does not contain any JavaScript code.
Any insights into what might be causing this problem would be greatly appreciated.


Thank you in advance for your assistance!

0
Portretas
Atmesti
Portretas
Hendra Ekky Saputra
Best Answer

Hi kahina, 

Recently i got this error too, and then after i digg in into the error i try to disable and make an if else condition to solve this error 

File that I was i editing was
odoo15\addons\web\static\src\legacy\js\control_panel\control_panel_model_extension.js

on the  _extractAttributes you can add if else condition, and console.log to check the output and heres the final code :

_extractAttributes(filter, attrs) {

            console.log("Extracting attributes:", attrs);  // Debugging attrs

            console.log("Filter object before processing:", filter);

            if (!attrs) {

                console.error("Missing or undefined attrs:", attrs);

                return;

            }

            if (!filter) {

                console.error("Missing or undefined filter:", filter);

                return;

            }

            if (attrs.isDefault) {

                filter.isDefault = attrs.isDefault;

            }

            filter.description = attrs.string || attrs.help || attrs.name || attrs.domain || 'Ω';

            switch (filter.type) {

                case 'filter':

                    if (attrs.context) {

                        filter.context = attrs.context;

                    }

                    if (attrs.date) {

                        filter.isDateFilter = true;

                        filter.hasOptions = true;

                        filter.fieldName = attrs.date;

                        // Cek apakah field ada sebelum mengakses 'type'

                        const field = this.fields[attrs.date];

                        if (field) {

                            filter.fieldType = field.type;

                        } else {

                            console.error(`Field ${attrs.date} not found in this.fields!`);

                            filter.fieldType = 'default'; // Set default fieldType jika tidak ditemukan

                        }

                        filter.defaultOptionId = attrs.default_period || DEFAULT_PERIOD;

                    } else {

                        filter.domain = attrs.domain || '[]';

                    }

                    if (filter.isDefault) {

                        filter.defaultRank = -5;

                    }

                    break;

                case 'groupBy':

                    filter.fieldName = attrs.fieldName;

                    // Cek apakah field ada sebelum mengakses 'type'

                    const groupField = this.fields[attrs.fieldName];

                    if (groupField) {

                        filter.fieldType = groupField.type;

                    } else {

                        console.error(`Field ${attrs.fieldName} not found in this.fields!`);

                        filter.fieldType = 'default';

                    }

                    if (['date', 'datetime'].includes(filter.fieldType)) {

                        filter.hasOptions = true;

                        filter.defaultOptionId = attrs.defaultInterval || DEFAULT_INTERVAL;

                    }

                    if (filter.isDefault) {

                        filter.defaultRank = attrs.defaultRank;

                    }

                    break;

                case 'field': {

                    const field = this.fields[attrs.name];

                    if (field) {

                        filter.fieldName = attrs.name;

                        filter.fieldType = field.type;

                    } else {

                        console.error(`Field ${attrs.name} not found in this.fields!`);

                        filter.fieldType = 'default';

                    }

                    if (attrs.domain) {

                        filter.domain = attrs.domain;

                    }

                    if (attrs.filter_domain) {

                        filter.filterDomain = attrs.filter_domain;

                    } else if (attrs.operator) {

                        filter.operator = attrs.operator;

                    }

                    if (attrs.context) {

                        filter.context = attrs.context;

                    }

                    if (filter.isDefault) {

                        let operator = filter.operator;

                        if (!operator) {

                            const type = attrs.widget || filter.fieldType;

                            if (["char", "html", "many2many", "one2many", "text"].includes(type)) {

                                operator = "ilike";

                            } else {

                                operator = "=";

                            }

                        }

                        filter.defaultRank = -10;

                        filter.defaultAutocompleteValue = {

                            operator,

                            value: attrs.defaultValue,

                        };

                    }

                    break;

                }

            }

            if (filter.fieldName && !attrs.string) {

                const field = this.fields[filter.fieldName];

                if (field) {

                    filter.description = field.string;

                } else {

                    console.error(`Field ${filter.fieldName} not found in this.fields for description!`);

                    filter.description = 'Ω';

                }

            }

        }

 

0
Portretas
Atmesti
Portretas
oyunsuren
Best Answer

Hi,

Maybe you have found a solution. But it may help someone.

I suggest you look at the current user's access rights. For example, I somehow used Project Stages on the window, which I tried to view but showed this error. So I enabled 'Use Stages on Project' for the logged-in user. After that, the error is gone.

0
Portretas
Atmesti
Portretas
Jort de Vreeze
Best Answer

What you can do to find out what is causing the problem, is go to 'Settings' and 'Activate the developer mode (with assets)'. If you now reload you page you can see in the console where the error occurs and in which file, e.g.:

This might be helpful to find out to find out more about this error. I hope this helps!

0
Portretas
Atmesti
Kahina
Autorius

The error message points to a problem in the file "/web/static/src/legacy/js/control_panel/control_panel_model_extension.js," specifically in the following line of code:
filter.fieldType = field.type;
The error message doesn't provide enough information for me to pinpoint the exact cause of the problem.

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

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

Registracija
Related Posts Replies Rodiniai Veikla
Issue Migrating bus_service Notification Handling from Odoo 17 to Odoo 18 (OWL-based POS)
pos js
Portretas
0
bal. 25
2837
Uncaught Promise > Cannot read properties of undefined (reading 'tag')
js v15
Portretas
Portretas
1
kov. 25
5075
Error in replace div in custom receipt
pos v15
Portretas
Portretas
1
liep. 24
3790
How i can modify JS method in POS? Solved
pos js
Portretas
1
rugs. 23
8401
[Odoo15ce] Error admin page. JS missing dependencies
js v15
Portretas
0
vas. 23
3213
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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