Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Owl Component call from one module to another

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
componentowl
2509 Weergaven
Avatar
Furqan

Hi I am trying to use public owl component from one module to another. my use case is I have to call it in same module as well and to another module too. Calling in the same module is working fine but other module isnt taking the props to call jsonrpc. Below is the code base for my component and where I am calling it.

Public owl js file

/* @odoo-module */

import {Component, onMounted, onWillStart, useRef, useState, useSubEnv} from "@odoo/owl";
import {registry} from "@web/core/registry"
import {jsonrpc} from "@web/core/network/rpc_service";



export class HomePlans extends Component {
static template = "franchisor_theme.home_plan_template";

setup() {
onWillStart(this._onWIllStart.bind(this))
this.imageDataUri = this.imageDataUri.bind(this);
console.log(this.props.data, this.props, 'this is not logging in console!')
this.state = useState({'home_plans': this.props.home_plans, 'partner': this.props.partner, 'community': this.props.community, FILETYPE_BASE64_MAGICWORD: {
'/': 'jpeg',
'i': 'png',
'R': 'gif',
'U': 'webp',
'Q': 'svg+xml'
}})
}
imageDataUri(base64Source) {
const mimeType = this.state.FILETYPE_BASE64_MAGICWORD[base64Source?.charAt(0)] || 'png';

return `data:image/${mimeType};base64,${base64Source}`;
}
async _onWIllStart() {
// console.log(this.state)
let params = {
community_slug: this.state.community ?? "",
partner_id: this.state.partner.id
};


try {
let communities = await jsonrpc("/get/partners/plans", params)
this.state.home_plans = communities
}catch(error){
console.error("Error Fetching Home Plans! ", error)
}

}



async _onMounted() {
}


}


registry.category("public_components").add("HomePlans", HomePlans);

Below is my js file where renderToElement is called:

/* @odoo-module */


import {Overlay} from "./overlay";
import {renderToElement} from "@web/core/utils/render";

export class ShapBase {
static component = {}

setup(GoogleMap, data) {
this.googleMap = GoogleMap
this.map = this.googleMap.map
}

openPreview() {
if (!this.preview) {
return
}
this.data.home_plans = {
name: "jkjk"
}
content = renderToElement('bista_map_component.lot_preview', {data: this.data})



}



}

lot_preview.xml

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="bista_map_component.lot_preview">
<div>

<!-- below is for status: Available-->
<section t-if="data.status_name == 'Available'" style="margin-top: 5rem; margin-right: 7px; margin-left: 7px;">

<div class="container mt-4">
<div class="row public_component">
<div t-esc="data.home_plans.name" />
<owl-component name="HomePlans" t-att-props="data.home_plans"/>
</div>
</div>

</section>
</div>
</t>
</templates>

But props are not being sent. Either its not reading it as a component or im just not passing props in the right way

0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Adding custom (non-default) slots to props validation (Solution)
owl
Avatar
1
jun. 24
2274
how to pass a value from controller to owl template
owl
Avatar
Avatar
1
mei 24
2969
Render a component in a button click Odoo 14
javascript component odoo owl v14
Avatar
Avatar
1
mei 23
4764
How to correctly handle grammatical gender inflection in Ukrainian translation?
translation owl
Avatar
0
nov. 25
74
Custom code: Can clicking on a Task with Subtasks (in Kanban View) open another Kanban with the Subtasks? Opgelost
owl OWL
Avatar
Avatar
Avatar
2
jul. 25
1982
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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