Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

How to create automation to create message in the Discuss Channel?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
Automationodoo16features
3 Replies
6513 Tampilan
Avatar
Nihat Demir

Hi Everyone, I need help to understand and help to create Automation rules. 

How to create automation rule when User create an opportunity or quotation, create message in the Discuss Channel?

0
Avatar
Buang
Nihat Demir
Penulis

Could you create me little video or screenshot pls? I am not technical.

Nihat Demir
Penulis

Thank you Jainesh. I have this error. Also sent you automation page screenshot

https://drive.google.com/file/d/1z9kxuMrqkA7_VIgs-5_BnJtq6wia5I6y/view?usp=sharing

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/home/odoo/16E/odoo/tools/safe_eval.py", line 339, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(1215,)", line 14, in <module>
File "/home/odoo/16E/odoo/models.py", line 1536, in search
res = self._search(domain, offset=offset, limit=limit, order=order, count=count)
File "/home/odoo/16E/odoo/models.py", line 4628, in _search
query = self._where_calc(domain)
File "/home/odoo/16E/odoo/models.py", line 4396, in _where_calc
return expression.expression(domain, self).query
File "/home/odoo/16E/odoo/osv/expression.py", line 447, in __init__
self.parse()
File "/home/odoo/16E/odoo/osv/expression.py", line 672, in parse
raise ValueError("Invalid field %s.%s in leaf %s" % (model._name, path[0], str(leaf)))
ValueError: Invalid field mail.channel.Sales in leaf ('Sales', '=', 'general')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/odoo/16E/odoo/http.py", line 1579, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/home/odoo/16E/odoo/service/model.py", line 134, in retrying
result = func()
File "/home/odoo/16E/odoo/http.py", line 1608, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/home/odoo/16E/odoo/http.py", line 1805, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/home/odoo/16E/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "/home/odoo/16E/odoo/addons/base/models/ir_http.py", line 144, in _dispatch
result = endpoint(**request.params)
File "/home/odoo/16E/odoo/http.py", line 698, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/home/odoo/16E/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/odoo/16E/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/odoo/16E/odoo/api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/home/odoo/16E/odoo/api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/odoo/16E/odoo/addons/base_automation/models/base_automation.py", line 415, in write
action._process(records, domain_post=domain_post)
File "/home/odoo/16E/odoo/addons/base_automation/models/base_automation.py", line 340, in _process
raise e
File "/home/odoo/16E/odoo/addons/base_automation/models/base_automation.py", line 337, in _process
action_server.sudo().with_context(**ctx).run()
File "/home/odoo/16E/odoo/addons/base/models/ir_actions.py", line 668, in run
res = runner(run_self, eval_context=eval_context)
File "/home/odoo/16E/odoo/addons/website/models/ir_actions_server.py", line 61, in _run_action_code_multi
res = super(ServerAction, self)._run_action_code_multi(eval_context)
File "/home/odoo/16E/odoo/addons/base/models/ir_actions.py", line 538, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "/home/odoo/16E/odoo/tools/safe_eval.py", line 353, in safe_eval
raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
ValueError: <class 'ValueError'>: "Invalid field mail.channel.Sales in leaf ('Sales', '=', 'general')" while evaluating
"# Available variables:\n# - env: Odoo Environment on which the action is triggered\n# - model: Odoo Model of the record on which the action is triggered; is a void recordset\n# - record: record on which the action is triggered; may be void\n# - records: recordset of all records on which the action is triggered in multi-mode; may be void\n# - time, datetime, dateutil, timezone: useful Python libraries\n# - float_compare: Odoo function to compare floats based on specific precisions\n# - log: log(message, level='info'): logging function to record debug information in ir.logging table\n# - UserError: Warning Exception to use with raise\n# - Command: x2Many commands namespace\n# To return an action, assign: action = {...}\n\nmessage = 'Hello Demo Message'\nenv['mail.channel'].search([('Sales', '=', 'general')]).message_post(body=message)"

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
at makeErrorFromResponse (https://netroneats.com/web/assets/1021-f3ff506/web.assets_backend.min.js:974:163)
at XMLHttpRequest.<anonymous> (https://netroneats.com/web/assets/1021-f3ff506/web.assets_backend.min.js:981:13)

Avatar
Jainesh Shah(Aktiv Software)
Jawaban Terbai

Hello Nihat Demir,

You Can Create Message in the Discussion Channel using Automated Action.

Find Example in comment.

I hope this will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari


0
Avatar
Buang
Jainesh Shah(Aktiv Software)

For Example -

- Create an Automated action by adding name, model, trigger (creation as per your requirement), filter domain (if required) and Action to do ( Execute Python Code as per your need )

- In the Python Code Below Paste this code:-
message = 'Hello Demo Message'
env['mail.channel'].search([('name', '=', 'general')]).message_post(body=message)
- Note :- For searching channel you have to give the name in the search condition.

Avatar
MUHAMMAD Imran
Jawaban Terbai

In order to automate the creation of a message in an Odoo Discuss channel, you will need to use the Odoo's ORM (Object-Relational Mapping) API.


Here is an example of how you might automate the creation of a message in an Odoo Discuss channel using Python:


Copy code

from odoo import api, models


class MyAutomatedMessage(models.Model):

    _name = 'my.automated.message'


    @api.model

    def create_message(self):

        # Replace with the ID of the channel you want to post to

        channel_id = 1


        # The message you want to post

        message = "Hello, this is an automated message."


        # Create the message

        self.env['mail.channel'].browse(channel_id).message_post(body=message, message_type='comment', subtype='mail.mt_comment')

This code creates a new Odoo model called MyAutomatedMessage with a method create_message(). Inside the method, it uses the browse() method of the mail.channel model to get the specific channel by its ID. Then it uses the message_post() method to create the message in the channel with the specified message text, message type, and subtype.


This is a simple example, you can use odoo's scheduler to schedule the creation of the message, or you could use the Odoo's API to create a custom endpoint that can be used to trigger the message creation from an external source.


You should also make sure that you have the necessary access rights to create messages in the channel.


Please note that you need to get your Odoo Discuss 

0
Avatar
Buang
Avatar
Paresh Wagh
Jawaban Terbai

Hi Nihat: You can do this by creating an automated action (Action to Do: Execute Python Code ) and call the message_post method on the channel.

0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
DeprecationWarning: The longpolling-port is a deprecated alias to the gevent-port option, please use the latter Diselesaikan
odoo16features
Avatar
Avatar
Avatar
Avatar
Avatar
5
Sep 25
24526
How to Add wizard under print button inside the form view.
odoo16features
Avatar
Avatar
Avatar
Avatar
3
Agu 25
3747
Automation active Boolean button
Automation
Avatar
Avatar
Avatar
Avatar
4
Jun 25
2511
How to add @api.onchange in _get_view() method odoo 16
odoo16features
Avatar
Avatar
1
Mei 25
3641
get all partners which are internal users or portal users odoo16
odoo16features
Avatar
Avatar
1
Apr 25
4485
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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