Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
Automationodoo16features
3 Respuestas
6519 Vistas
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
Descartar
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)

Avatar
Jainesh Shah(Aktiv Software)
Mejor respuesta

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
Descartar
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
Mejor respuesta

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
Descartar
Avatar
Paresh Wagh
Mejor respuesta

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
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
DeprecationWarning: The longpolling-port is a deprecated alias to the gevent-port option, please use the latter Resuelto
odoo16features
Avatar
Avatar
Avatar
Avatar
Avatar
5
sept 25
24534
How to Add wizard under print button inside the form view.
odoo16features
Avatar
Avatar
Avatar
Avatar
3
ago 25
3749
Automation active Boolean button
Automation
Avatar
Avatar
Avatar
Avatar
4
jun 25
2513
How to add @api.onchange in _get_view() method odoo 16
odoo16features
Avatar
Avatar
1
may 25
3642
get all partners which are internal users or portal users odoo16
odoo16features
Avatar
Avatar
1
abr 25
4493
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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