Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Merge chatter messages in two modules (Sales and Project task)

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
automatedactionsmessageschatter
3 Antwoorden
3138 Weergaven
Avatar
Peter Jonsson

I am in need of merging messages in sale order with associated project task and i would like to do this using automated action. Does someone have an idea on how to achieve this? I'm on Odoo 14.


Thanks

Peter


1
Avatar
Annuleer
Avatar
Yaroslav Lyusikov
Beste antwoord

Hi Peter,

  1. Create new Automated Action.
  2. Model = Message
  3. Trigger = On Creation.
  4. Action To Do = Execute Python Code.
  5. Enter the code: 
if record.model == 'sale.order':
sale_order = env['sale.order'].browse(record.res_id)
for task in env['project.task'].search([('sale_line_id', 'in', sale_order.order_line.ids)]):
task.message_post(body=record.body)

This script checks if the new message is linked to a sale order.

If it is, it gets the sale order and finds the associated project tasks by searching the project.task model for tasks related to the order lines in the sale order.

Then it posts the new message on each of these tasks (there may be many tasks related to one sale order).

_______________________

OR you can restrict domain on the form of Automated action and leave the code without 

if record.model == 'sale.order':

__________________________________

Also note that the system creates a new letter in the project task by simply copying the text from the sale order message. And this means that if the task and the sale order have the same users in the followers, then such followers will receive duplicates of the original letter.

__________________________________
Please add more business context next time)

2
Avatar
Annuleer
Peter Jonsson
Auteur

Many Thanks Yaroslav! This is exactly what i was looking for and it works just the way i need it to.

I´m sorry if i was a bit short in my question about the use case. We work with services and each order line on a sales order creates a task in project. Mainly the communication with the customer is made from sales, but the information needs to pass over to task department.
It is not a problem that the complete message history are tracked in each of the corresponding tasks, it still serves its purpose. I understand what you mean with the followers getting duplicates and maybe i´ll have to handle this further on.

What if i want to do the opposite, pass information from task to sales order? Would it be possible to merge tasks messages into one sales order? So that when a sales person communicates with a customer, they also have a complete service history from our technicians.

Many thanks and regards
Peter

Yaroslav Lyusikov

Peter, I'm glad the automatic action worked the way you wanted.
But I don't like your second idea, because you want to trigger automatic message creation in the Task, which should trigger automatic message creation in the Sales Order and so on infinitely.
This is not necessarily a blocker in general, for example you can check if the message is created by an actual user and not the system itself ( if record.create_uid.id != 1: ):

if record.model == 'sale.order':
sale_order = env['sale.order'].browse(record.res_id)
if record.create_uid.id != 1:
for task in env['project.task'].search([('sale_line_id', 'in', sale_order.order_line.ids)]):
task.message_post(body=record.body)

but I advise you to contact Odoo partners for more complex solutions.

Peter Jonsson
Auteur

I understand what you are saying.

I have been looking for some apps that could achieve this more advanced solution but without success. I might leave it as a one way communication channel for the moment and bring it up with my Odoo partner later on.

Your solution is beautiful and of great help to me! Many thanks Yaroslav!

//Peter

Avatar
Peter Jonsson
Auteur Beste antwoord

I understand what you are saying. 

I have been looking for some apps that could achieve this more advanced solution but without success. I might leave it as a one way communication channel for the moment and bring it up with my Odoo partner later on. 

Your solution is beautiful and of great help to me! Many thanks Yaroslav!


//Peter

0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Code automated actions for custom Sale Order sequences in Odoo 12
automated actions
Avatar
Avatar
1
feb. 21
5326
Automated Actions : Created Product Name automatically and internal reference automatically
automated actions
Avatar
Avatar
3
jun. 20
5845
Automated actions - creating directories (v13)
automated actions
Avatar
0
jun. 20
3485
How to set automated action to inactive a user on cretin date ?
automated actions
Avatar
0
feb. 16
4589
Warnings in automated actions
automated actions warning
Avatar
0
aug. 23
4508
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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