İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

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

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
emailexternalapixmlrpc
1 Cevapla
5033 Görünümler
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
Vazgeç
Avatar
Stanislas Gueniffey (stgu)
En İyi Yanıt
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
Vazgeç
Enjoying the discussion? Don't just read, join in!

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Java xmlrpc not working
external api xmlrpc java
Avatar
Avatar
1
Ara 22
3570
Send email for sign request through API
email api xmlrpc typeerror sign
Avatar
Avatar
Avatar
Avatar
3
Mar 24
6065
Reset user Password from xmlrpc Odoo 12
external api xmlrpc resetpassword mobileapp
Avatar
Avatar
1
Oca 23
2981
XML-RPC API search_read method 100 records' limitation
api xmlrpc
Avatar
Avatar
Avatar
3
Oca 23
9366
External API's Çözüldü
developement external api xmlrpc v14
Avatar
Avatar
1
Haz 22
4495
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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