Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

I want to sent invoice to the coustomer email using external api

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
emailexternalapixmlrpc
1 Balas
5047 Tampilan
Avatar
ss Sdf

As i am new to the odoo i need some help. i want to sent my created invoice to the coustomer email using external api. here is my code how i am creating the invoice 

import xmlrpc.client

# Odoo API information
url = ''
db = ''
username = ''
password = ''

# Connect to Odoo API
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
uid = common.authenticate(db, username, password, {})

# Create a connection object
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))

customer_id=10
product_id
=1
# Create an invoice
invoice_data = {
'partner_id': customer_id, # ID of the customer for whom you want to create the invoice
'move_type': 'out_invoice', # Invoice type (out_invoice for customer invoice)
# Add other invoice data like invoice line items, payment terms, etc.
# For example:
'invoice_line_ids': [
(
0, 0, {
'product_id'
: product_id, # ID of the product on the invoice line
'quantity': 2,
'price_unit': 100.0,
})
]
,
}

invoice_id = models.execute_kw(db, uid, password, 'account.move', 'create', [invoice_data])

# Send the invoice by email
models.execute_kw(db, uid, password, 'account.move', 'action_post', [invoice_id])
invoice_sent = models.execute_kw(db, uid, password, 'account.move', 'action_invoice_sent', [invoice_id])

i am using odoo online. kindly help. 

0
Avatar
Buang
Avatar
Stanislas Gueniffey (stgu)
Jawaban Terbai
import xmlrpc.client

# Odoo API information: edit it to match your config
url = 'http://localhost:8069'
db = 'MY_DB'
username = 'admin'
password = 'admin'

# Connect to Odoo API
# You may support *sending* None values by passing allow_none=True to the ServerProxy
# In order to *receive* None values you would have to modify odoo core (not recommended)
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
uid = common.authenticate(db, username, password, {})

# Create a connection object
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))

# Create and post an invoice
invoice_data = {
'partner_id': 10,
'move_type': 'out_invoice',
'invoice_line_ids': [
(0, 0, {
'product_id': 1,
'quantity': 2,
'price_unit': 100.0,
})
],
}
invoice_id_1 = models.execute_kw(db, uid, password, 'account.move', 'create', [invoice_data])
invoice_id_2 = models.execute_kw(db, uid, password, 'account.move', 'create', [invoice_data])
invoice_ids = [invoice_id_1, invoice_id_2]
models.execute_kw(db, uid, password, 'account.move', 'action_post', [invoice_ids])

# Prepare values to create send & print wizard
action_vals = models.execute_kw(db, uid, password, 'account.move', 'action_send_and_print', [invoice_ids])

# arguments
# 1) the ORM create() method needs arguments to complete, since that method starts with
# if not vals_list:
# return self.browse()
# 2) the is_print arg avoids the local printing and downloading of the PDF
# this is simply because account.invoice.send's _print_document() method returns a dict
# containing a None value, which is not supported in xmlrpc unless allow_none is enabled
# 3) the composition_mode is necessary to send multiple e-mails at once
wizard_args = [{'is_print': False, 'composition_mode': 'mass_mail'}]

# keyword arguments: the context contains some necessary values such as active_ids
wizard_kwargs = {'context': action_vals.get('context')}

# Create the wizard
wizard_id = models.execute_kw(db, uid, password, 'account.invoice.send', 'create', wizard_args, wizard_kwargs)

# Use the wizard to send the e-mails
# we provide the context once more as send_and_print_action also relies on it for active_ids
wizard_close = models.execute_kw(db, uid, password, 'account.invoice.send', 'send_and_print_action', [wizard_id], wizard_kwargs)

0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Java xmlrpc not working
external api xmlrpc java
Avatar
Avatar
1
Des 22
3577
Send email for sign request through API
email api xmlrpc typeerror sign
Avatar
Avatar
Avatar
Avatar
3
Mar 24
6071
Reset user Password from xmlrpc Odoo 12
external api xmlrpc resetpassword mobileapp
Avatar
Avatar
1
Jan 23
2992
XML-RPC API search_read method 100 records' limitation
api xmlrpc
Avatar
Avatar
Avatar
3
Jan 23
9374
External API's Diselesaikan
developement external api xmlrpc v14
Avatar
Avatar
1
Jun 22
4499
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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