Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

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

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
Automationodoo16features
3 Odpowiedzi
6515 Widoki
Awatar
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
Awatar
Odrzuć
Nihat Demir
Autor

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

Nihat Demir
Autor

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)

Awatar
Jainesh Shah(Aktiv Software)
Najlepsza odpowiedź

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
Awatar
Odrzuć
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.

Awatar
MUHAMMAD Imran
Najlepsza odpowiedź

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
Awatar
Odrzuć
Awatar
Paresh Wagh
Najlepsza odpowiedź

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
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
DeprecationWarning: The longpolling-port is a deprecated alias to the gevent-port option, please use the latter Rozwiązane
odoo16features
Awatar
Awatar
Awatar
Awatar
Awatar
5
wrz 25
24533
How to Add wizard under print button inside the form view.
odoo16features
Awatar
Awatar
Awatar
Awatar
3
sie 25
3748
Automation active Boolean button
Automation
Awatar
Awatar
Awatar
Awatar
4
cze 25
2513
How to add @api.onchange in _get_view() method odoo 16
odoo16features
Awatar
Awatar
1
maj 25
3642
get all partners which are internal users or portal users odoo16
odoo16features
Awatar
Awatar
1
kwi 25
4493
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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