Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Automation for creating and sending invoices from CRM

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
crminvoicingautomation
1 Svar
880 Visninger
Avatar
Otto

Hey, I'm new to Odoo. I need to send 100s of invoices that are either for product A or product A+B to 100s of customers. I was hoping I could make an automation in the CRM module so that when I change an opportunity to stage X in the CRM -> create and send invoice to customer associated with the opportunity. If my custom property checkbox is left unchecked, then invoice with item A should be sent, and if checked, invoice with products A+B should be sent. Prices are constant for both products so the outgoing invoices are always one of two amounts (no customisation needed). 


How might I go about doing this? In Automation Rules, the Trigger seems straight forward, but the Action not so much...


Thank you

0
Avatar
Kassér
Otto
Forfatter

You have no idea how much time this has saved me. Thank you so very much! I made a few adjustments: I added logic to link to an existing invoice if one already matches (so it won’t create duplicates), built product lines dynamically based on a selection and quantity, added a small discount for extra units, wrapped everything in error handling with chatter feedback, and made the email sending a bit more robust. Works perfectly now!

Thanks again 🙏

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Bedste svar

Hi,

Steps:

Go to Settings → Technical → Automation → Automated Actions.

Create a new one:

Model = CRM Lead

Trigger = On Update

Condition = stage_id == 'X'

Action to do: Execute Python Code.

Code:

# This runs in the context of crm.lead record(s)

for lead in records:

    partner = lead.partner_id

    if not partner:

        continue


    # Decide which products to add

    product_ids = []

    if lead.x_my_checkbox:  # your custom field

        product_ids = [env.ref('your_module.product_a').id,

                       env.ref('your_module.product_b').id]

    else:

        product_ids = [env.ref('your_module.product_a').id]


    # Create invoice (draft)

    invoice = env['account.move'].create({

        'move_type': 'out_invoice',

        'partner_id': partner.id,

        'invoice_line_ids': [

            (0, 0, {

                'product_id': pid,

                'quantity': 1,

                'price_unit': env['product.product'].browse(pid).lst_price,

            }) for pid in product_ids

        ]

    })


    # Post and send by email

    invoice.action_post()

    template = env.ref('account.email_template_edi_invoice')

    invoice.message_post_with_template(template.id)


Hope it helps.

0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Create opportunity each month based on pasts orders
crm automation
Avatar
Avatar
1
aug. 24
2698
How to automatically create activity on stage change in CRM?
crm automation
Avatar
Avatar
1
nov. 23
4548
CRM - bring leads back from archive automatically
crm automation
Avatar
0
maj 20
3667
CRM: automatically move an Opp when a quote is created?
crm stages automation
Avatar
Avatar
Avatar
2
aug. 25
2306
CRM: Create Automation to re-create a re-order/follow up Løst
crm opportunity automation
Avatar
Avatar
2
dec. 24
2224
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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