Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

how can i get uuid of two users in im_chat to identify and send message

Odebírat

Get notified when there's activity on this post

This question has been flagged
2 Odpovědi
6688 Zobrazení
Avatar
shaneebkhan

how can i get uuid of two users in im_chat to identify and send message

ex:

'hr'  want to send a message(im_chat) to 'employee' for every mail  send .

for this want to get uuid of between hr and employee

0
Avatar
Zrušit
Avatar
Vasanth
Nejlepší odpověď

In the following code in im_chat.py you can get the sender and receivers details for the current session :

  def users_infos(self, cr, uid, ids, context=None):
        """ get the user infos for all the user in the session """
        for session in self.pool["im_chat.session"].browse(cr, uid, ids, context=context):
            users_infos = self.pool["res.users"].read(cr, uid, [u.id for u in session.user_ids], ['id','name', 'im_status'], context=context)
            return users_info

 

if you want their uid ,yiu can get it from the following methos in im_chat.py:

    def post(self, cr, uid, from_uid, uuid, message_type, message_content, context=None):
        """ post and broadcast a message, return the message id """
        message_id = False
        Session = self.pool['im_chat.session']
        session_ids = Session.search(cr, uid, [('uuid','=',uuid)], context=context)
        notifications = []
        for session in Session.browse(cr, uid, session_ids, context=context):
            # build the new message
            vals = {
                "from_id": from_uid,
                "to_id": session.id,
                "type": message_type,
                "message": message_content,
            }
            # save it
            message_id = self.create(cr, uid, vals, context=context)
            # broadcast it to channel (anonymous users) and users_ids
            data = self.read(cr, uid, [message_id], ['from_id','to_id','create_date','type','message'], context=context)[0]
            notifications.append([uuid, data])
            for user in session.user_ids:
                notifications.append([(cr.dbname, 'im_chat.session', user.id), data])
            self.pool['bus.bus'].sendmany(cr, uid, notifications)
        return message_id

Note:

 in session.users ids,  you can get the sender and receiver ids

from_uid you can get the message sender id

message_content you can see the outgoing message.

Hope it will helps you

 

2
Avatar
Zrušit
Avatar
shaneebkhan
Autor Nejlepší odpověď

crm_phonecall  (this have to write perticular event )  here it is logged calls ..

 if values.get('user_id'):

            from_uid=uid

            to_uid=values.get('user_id')   

            self.pool['im_chat.message'].postfirst(cr, uid, from_uid,to_uid, 'message','you allocated for one work ,check you inbox', context)

 

 

im_chat  (this function add into im_chat  module)

       

def postfirst(self, cr, uid, from_uid,to_uid,message_type, message_content, context=None):

        """ post and broadcast a message, return the message id """

        print ''

        #print 'context', context ,'uid', uid, 'from_uid',from_uid, 'uuid',uuid, 'message_content',message_content,

        print ''

        info = self.pool['im_chat.session'].session_info(cr, from_uid, to_uid , context)

        print 'postinfo',info,'from_uid',from_uid

        

        message_id = False 

        

        uuid=info['uuid']

        Session = self.pool['im_chat.session']

        session_ids = Session.search(cr, uid, [('uuid','=',uuid)], context=context)

        print session_ids

        notifications = []

        for session in Session.browse(cr, uid, session_ids, context=context):

            # build the new message

            print 'from_uid' ,from_uid ,'session.id' ,session.id

            vals = {

                "from_id": from_uid,

                "to_id": session.id,

                "type": message_type,

                "message": message_content,

            }

            # save it

            message_id = self.create(cr, uid, vals, context=context)

            # broadcast it to channel (anonymous users) and users_ids

            data = self.read(cr, uid, [message_id], ['from_id','to_id','create_date','type','message'], context=context)[0]

            notifications.append([uuid, data])

            for user in session.user_ids:

                notifications.append([(cr.dbname, 'im_chat.session', user.id), data])

            self.pool['bus.bus'].sendmany(cr, uid, notifications)

        return message_id

0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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