Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • 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 Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & 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
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
posjsv15
3 Replies
16948 Views
Avatar
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
Avatar
Discard
Avatar
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
Avatar
Discard
Avatar
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
Avatar
Discard
Avatar
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
Avatar
Discard
Kahina
Author

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!

Sign up
Related Posts Replies Views Activity
Issue Migrating bus_service Notification Handling from Odoo 17 to Odoo 18 (OWL-based POS)
pos js
Avatar
0
Apr 25
2627
Uncaught Promise > Cannot read properties of undefined (reading 'tag')
js v15
Avatar
Avatar
1
Mar 25
4942
Error in replace div in custom receipt
pos v15
Avatar
Avatar
1
Jul 24
3665
How i can modify JS method in POS? Solved
pos js
Avatar
1
Sep 23
8234
[Odoo15ce] Error admin page. JS missing dependencies
js v15
Avatar
0
Feb 23
3102
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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