Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

JavaScript Module inherit mail.Chatter - getting "Missing dependencies"

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
javascriptchatterMissingErrorv14mail.chatter
2 Răspunsuri
7417 Vizualizări
Imagine profil
Benedikt Rauch

Hello.

I want to include chatter functionality with some JavaScript in an odoo 14 Addon.

For that I added the dependency for "mail" and require("mail.Chatter") in the js.

Then I get a warning:

Missing dependencies: ["mail.Chatter"]

Non loaded modules: ["addon_name"]


I don't know is missing. Most of search results are quite outdated.

manifest has the dependency:

{
    "depends": ["mail"],
"external_dependencies": {"python": ["extract_msg"]},
"data": ["views/templates.xml", "views/res_config_settings_views.xml"],
}


my template.xml

<odoo>
<data>
<template
id="assets_backend"
name="adddon_name assets"
inherit_id="web.assets_backend"
>

<xpath expr="." position="inside">
<script
type="text/javascript"
src="/addon_name/static/src/js/addon_name.js"
/>
</xpath>
</template>
</data>
</odoo>


and my addon_name.js has this:

odoo.define("addon_name", ['mail.Chatter'], function(require) {
    "use strict";

    var Chatter = require("mail.Chatter");

   Chatter.include({
        // my code        
    );
})



Thanks for your suggestions.

0
Imagine profil
Abandonează
Imagine profil
Xavier Dubuc
Cel mai bun răspuns

Hi Ibrahim, in Odoo 14, all mails modules are migrated to new javascript odoo framework OWL ( https://github.com/odoo/owl ). You could look into modules like approvals & livechat to see how you should inherit from a component or a model.

Also have a look in form_renderer.js of mail module, this is where Chatter is loaded, it's kind of a specific way of doing, so maybe it can meet what you need exactly.

If you don't manage to achieve what you want to do, please give me more information and I'll try to give you more information.

 

0
Imagine profil
Abandonează
Imagine profil
Ibrahim Boudmir
Cel mai bun răspuns

there is no syntax like odoo.define("addon_name", ['mail.Chatter'], function(require) { ... })

you should know that define is a function that takes 2 arguments : name of the module js and the function:

odoo.define("addon_name", function(require) {...})

Then the second problem is require("mail.Chatter"); 

there's no such js module. That's why odoo tells you that this dependancy is not found.


You may want to look at : addons/mail/static/src/components/chatter

That's for sure where you need to start. 

P.S : you said you need to extend but in your code you did a include.. the 2 are different.


Hope this helps.

0
Imagine profil
Abandonează
Benedikt Rauch
Autor

Thank you for your answer.

Following the docs: https://www.odoo.com/documentation/14.0/reference/javascript_reference.html#javascript-module-system

There is this example:

"An alternative way to define a module is to give explicitly a list of dependencies in the second argument."

odoo.define('module.Something', ['module.A', 'module.B'], function (require) {

"use strict";

var A = require('module.A');

var B = require('module.B');

// some code

});

I was trying to follow this - but maybe I got it wrong.

But yes, that's basically the question: how to use this chatter from mail Addon.

(addons/mail/static/src/components/chatter)

I found this Addon (for odoo 13) which does pretty much what I need: https://github.com/OCA/social/tree/13.0/mail_drop_target

Importing the require("mail.Chatter");

Well. I guess "include chatter functionality" is more accurate.

Ibrahim Boudmir

Hi Benedikt,

1- odoo.define('module.Something', ['module.A', 'module.B'], function (require) {...}) : Thanks for the hint. I did not know that.

2- require("mail.Chatter");

This is true if you're on Odoo13 or less and The link to OCA module is for V13. You can find that the js module with name mail.Chatter does exist ( look at addons/mail/static/src/js/chatter.js ). Therefore, you can call it.

But in Odoo14, it ain't the case.

Gonna need to search more for the equivalent in the path i gave in my answer.

Good luck

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Odoo14 Use specific Dialog extension for a form-view with custom js_class
javascript v14
Imagine profil
0
mai 23
4198
How fix the column width of a Field in Tree view in Odoo14 Rezolvat
javascript v14
Imagine profil
Imagine profil
1
ian. 23
8975
Is there a way to pin a chat in odoo 14?
chatter v14
Imagine profil
Imagine profil
1
dec. 22
3810
ReferenceError: instance is not defined Rezolvat
javascript v14
Imagine profil
Imagine profil
1
dec. 20
8497
How to Hide Chatter Rezolvat
chatter v14
Imagine profil
Imagine profil
2
oct. 20
9030
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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