Skip to Content
Odoo Menu
  • Prijavi
  • 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
  • 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č

[v15] POS OWL framework Abstract Concepts

Naroči se

Get notified when there's activity on this post

This question has been flagged
javascriptposframeworkOWL
4126 Prikazi
Avatar
Odoo4Life

Hello there,

I have been learning the OWL framework by doing the todo list tutorial. I have completed the tutorial and understood the concepts of components, hooks, templates, event handling, reactivity, etc.

Now I am going through the POS app and trying to understand how OWL was used in Odoo specifically. However, except from the templates, I cannot seem relate the code from Odoo POS with the OWL tutorial code.

This is why I would like to ask here to get some more details and hopefully understand the way in which it is written.

I was looking specifically at the ProductScreen component within the Point of Sale and trying to understand it.
Below I have added specific questions.
I have attached three links to images with screenshot of what I will refer to in the following questions.

1. How does Odoo instantiate classes (such as class ProductScreen).What is the trigger for the instantiation and what does the instantiated object reference?
For example: In regular Javascript I have to use the "new" keyword to create an instance of the class. However, I do not see that in the code. So I'm wondering how Odoo does this.

2. What does ProductScreen.template = 'ProductScreen' represent? Is that the same as static template = xml `

....
` of the OWL tutorial? Instead of it being inline, the  ".template" method is used to reference it?

3.What does Registries.Component.add(ProductScreen) do? I suppose it adds it to the registry. What is the registry? I read that it is a key,value map. Is it some sort of Object? what does Odoo do with the registry once the component is added to it?

4. What does return ProductScreen do? What root component is calling on the ProductScreen component for its return? is it returned as an instance of the class?

Sorry I am asking so many questions about this. I just seem to find it very interesting, but couldn't find a lot of information about these concepts. And thought this might be the best place to ask.


Any help would be greatly appreciated, thanks!

https://ibb.co/mJdfztz

https://ibb.co/YkqhmKq

https://ibb.co/nLgVhjJ

0
Avatar
Opusti
Odoo4Life
Avtor

Alright so I've been putting many hours of research on this topic and I think I've found some answers to some of the questions:

- The Main.js file (addons/point_of_sale/static/src/js/main.js), contains the PosApp class which is the Root component of the Point of Sale addon/module.

- The PosApp component has a method called Setup(). This method is used as a class constructor. Within this method there is a "this.Components" property. All entries within the registry category: "main components", are stored in an array and assigned to the Components property.
This means that the registry is used as a means to store references to all the components that make up the Point of Sale module.

- The PosApp component also has the static template = xml`...`. Which is taught in the OWL documentation. Within this template is a foreach tag, which is used to loop through the "this.Components" array. Hereby, laying out all other component's templates in the process.

The above brings an understanding to:
1. When the foreach loop runs, it instantiates each component.
3 The use of registry is to store a the references of each component under certain registry category.

To whoever reads this and sees that their are flaws to the above-mentioned. Please correct me.

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
How inherit the point of sale Java script class in odoo 17
javascript pos OWL v17
Avatar
Avatar
1
dec. 24
3374
How can I use orm with JavaScript in PosOrder prototype file
javascript pos orm OWL Odoo 18
Avatar
Avatar
2
jul. 25
2721
py.eval in Javascript
javascript OWL
Avatar
0
jan. 25
1826
does odoo 17 allow to add button to Navbar header in point of sale session inside it to get dynamic data
javascript pos
Avatar
Avatar
1
nov. 24
2212
How to add product in POS programmatically Solved
javascript pos
Avatar
Avatar
Avatar
Avatar
4
okt. 24
5212
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