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
    • Guest House
    • Drankenhandelaar
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Solar Energy Systems
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC Services
    Others
    • Nonprofit Organization
    • 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

Need some help for action on incoming email

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
pythonemaillead
5979 Weergaven
Avatar
Benoit COVILLE

Hi,

I'm trying to triger an action on incoming email in OpenERP Server. I would like OpenERP to create a new lead filled with informations from the content of this email. I read some some subject about this in Q/A but didn't achieve to do this ?? I created a server action of type python code on incoming email but OpenERP only create a new lead without filling other fileds with my code. Sure, I'm not a king in python programing but perhaps someone could help me ?

Here's the code:

def parse_description(description): ''' parse function for parsing messages like this: Nom|{Nom:value} Telephone|{Telephone:value} Structure|{Structure:value} Education|{Education:value} Sante|{Sante:value} Statut|{Statut:value} lits|{lits:value} Societe|{Societe:value} poste|{poste:value} Email|{Email:value} Adresse|{Adresse:value} CP|{CP:value} Ville|{Ville:value} Objet|{Objet:value} Demande|{Demande:value} Provenance|{Provenance:value} Newsletter|{Newsletter:value} ''' fields=['Nom','Telephone','Structure','Education','Sante','Statut','lits','Societe','poste','Email','Adresse','CP','Ville','Pays','Objet','Objet_autre','Demande','Provenance','Newsletter'] _dict={} for line in description.split('\n'): for field in fields: if field in line: split_line=line.split('|') if len(split_line)>1: _dict[field]=split_line[1] return _dict lead=self.browse(cr,uid,context['active_id'],context=context) description=lead['description'] _dict=parse_description(description) ''' Mapping des champs ''' test_newsletter=_dict.get(u'Newsletter') if test_newsletter == "Abonnement lettre information": newsletter='t' else: newsletter='f' test_provenance=_dict.get('Provenance') if test_provenance == "Web": channel='1' elif test_provenance == "Courrier / pub": channel='7' elif test_provenance == "Recommandation": channel='3' elif test_provenance == "Salon / foire": channel='5' elif test_provenance == "Facebook, Twitter, ...": channel='6' elif test_provenance == "Emailing": channel='4' elif test_provenance == "Telephone": channel='2' else: channel='8' self.write(cr,uid,context['active_id'],{ 'partner_name':_dict.get('Societe'), 'contact_name':_dict.get('Nom'), 'phone':_dict.get(u'Telephone'), 'street':_dict.get(u'Adresse'), 'city':_dict.get(u'Ville'), 'channel_id':channel, 'function':_dict.get(u'poste'), 'description':_dict.get(u'Demande'), 'email_from':_dict.get(u'Email'), 'opt_out':newsletter, 'country_id':'76', 'zip':_dict.get(u'CP'), 'ref':_dict.get(u'Structure')+" "+_dict.get(u'Sante')+" "+_dict.get(u'Statut')+" "+_dict.get(u'lits'), 'name':_dict.get(u'Objet')})

Many thanks for your advices.

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
How to write python code for server action?
python lead
Avatar
0
okt. 16
10804
How to ignore certain email addresses when creating a lead?
email lead
Avatar
0
mrt. 15
4564
Email template - list of followers
python qweb email
Avatar
Avatar
Avatar
2
jun. 23
3173
How to get information from the body of an email for a lead
email leads lead
Avatar
Avatar
1
mei 22
9736
Email replies not visible in Odoo
email reply lead
Avatar
Avatar
Avatar
2
jul. 24
11276
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