İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

How to Override a method in parent class in JS

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
inheritance
2 Cevaplar
4452 Görünümler
Avatar
Ngoc

Dear all,

I want to override a method in a parent class in JavaScript:

/** @odoo-module */

import { Product } from '@sale_product_configurator/js/product/product';

Product.include({
/**
* @override
*/
setQuantity() {
console.log('zzzzz');
},
});

TypeError: Product.include is not a function

Help me please. Than you very much.
0
Avatar
Vazgeç
Avatar
Dương Nguyễn
En İyi Yanıt

Odoo 17 has new syntax, use this

/** @odoo-module */


import { patch } from "@web/core/utils/patch";

import { Product } from '@sale_product_configurator/js/product/product';


patch(Product.prototype, {

/**

* @override

*/

setQuantity() {

console.log('zzzzz');

},

})



0
Avatar
Vazgeç
Kent

This new syntax confuses me. I am trying to do something similar. My code is:

odoo.define('pkcg_appointments_customizations.CustomCalendarCommonRenderer', ['web.CalendarCommonRenderer'], function (require) {
'use strict';

const CalendarCommonRenderer = require('web.CalendarCommonRenderer');

CalendarCommonRenderer.include({
onEventRender: function (event) {
this._super.apply(this, arguments);

console.log('TESTING TESTING TESTING');
}
});
});

I am trying to override the onEventRender method to include some additional logic. Would I use the same structure as you suggest above somehow?

Dương Nguyễn

Last time i check, Calendar JS has been converted into Owl entirely in odoo 17, so yes you should use the same structure i suggest

Avatar
Ngoc
Üretici En İyi Yanıt

It is done.

Thank you very much, Duong Nguyen.

Can you help me how to add a new method in an existing JS class in odoo17? (not create a new JS class)

0
Avatar
Vazgeç
Dương Nguyễn

just write your method, like the code i give.
P/S can you mark my answer as best one please

Dương Nguyễn

Are you a dude ?

Ngoc
Üretici

Thank Duong Nguyen. I am newbie, I can not vote. I am very sorry.

Dương Nguyễn

Ok if you need help you ask me via my facebook https://www.facebook.com/duong.messi.3/ or you can post on this forum, i need to gain more vote to get more xp

Ngoc
Üretici

Hi Duong Nguyen,
I have a JS class with setup method as below:
export class ProductConfiguratorDialog extends Component {
setup() {
useSubEnv({
mainProductTmplId: this.props.productTemplateId,
currencyId: this.props.currencyId,
setQuantity: this._setQuantity.bind(this),
});
}
Now I want to inherit and add more items for useSubEnv:
useSubEnv({
setFromDate: this._setFromDate.bind(this),
setToDate: this._setToDate.bind(this),
});
How can I do?

Dương Nguyễn

I haven't tested it, but try to import it then write like this
ProductConfiguratorDialog.props = {
...ProductConfiguratorDialog.props,
setFromDate: this._setFromDate.bind(this),
setToDate: this._setToDate.bind(this),
};

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

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Can't inherit base.view_partner_form of res.partner
inheritance
Avatar
Avatar
Avatar
Avatar
Avatar
4
Şub 25
4250
Include in inherit from JS class
inheritance
Avatar
Avatar
1
Ağu 24
2992
How to add a simple field to partner?
inheritance
Avatar
Avatar
Avatar
Avatar
3
Eki 23
15796
Do I have to create a new module to change the standard form view?
inheritance
Avatar
Avatar
2
Şub 23
3212
inherit problem: "cannot be located in parent view " for a <p /> inherited for sale_report_templates.line line 169
inheritance
Avatar
Avatar
1
Ara 22
1371
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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