Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Guest House
    • Distributeur de boissons
    • Hotel
    Real Estate
    • Real Estate Agency
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consulting
    • Accounting Firm
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Solar Energy Systems
    • Cordonnier
    • Services de nettoyage
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

[v15] POS OWL framework Abstract Concepts

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
javascriptposframeworkOWL
4113 Vues
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
Ignorer
Odoo4Life
Auteur

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.

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
How inherit the point of sale Java script class in odoo 17
javascript pos OWL v17
Avatar
Avatar
1
déc. 24
3355
How can I use orm with JavaScript in PosOrder prototype file
javascript pos orm OWL Odoo 18
Avatar
Avatar
2
juil. 25
2707
py.eval in Javascript
javascript OWL
Avatar
0
janv. 25
1813
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
2208
How to add product in POS programmatically Résolu
javascript pos
Avatar
Avatar
Avatar
Avatar
4
oct. 24
5195
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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