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

How to loop in an Email Template - Odoo 10

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
emailsendlooptableemail_template
3 Replies
8251 Tampilan
Avatar
Deborah Joy Adeva
this is on py:
I need to loop the table td

please help me, thanks


THIS IS MY CODE:

all_contract_id = self.env['hr.contract'].search([]) --- This is the one I need to loop in the td
template = self.env.ref('hr_data.email_template_contract_pending')
template_rec = self.env['mail.template'].sudo().browse(template.id)
values = {}
values.update({'email_to': email_to,
'send_to': send_to,
'body_html': "<p>Dear Human Resource," +
"<br/><br/> This email is to notify you that " + con.employee_id.name +"'s deployment to " + con.partner_id.name + " was on its fifth (5)month and will be expired thirty (30) days from now, "+ date_today.strftime("%B %d, %Y")+
"<br/><br/>" +
con.employee_id.name +"'s"+ " Employment History"
" <table style='border: 1px solid;background-color:#FFFFFF;width:80%;text-align:center;border-spacing:0;'> "
" <thead style='background-color:black;'>"
" <tr>"
" <th style='padding:10px;font-size:15px;color:white;text-align:center;'>Assigned Company</th> "
" <th style='padding:10px;font-size:15px;color:white;text-align:center;'>Start Date</th> "
" <th style='padding:10px;font-size:15px;color:white;text-align:center;'>End Date</th> "
" <th style='padding:10px;font-size:15px;color:white;text-align:center;'>Contract Duration with Client</th> "
" <th style='padding:10px;font-size:15px;color:white;text-align:center;'>Contract Duration with Us "
" </tr>"
"</thead>"
"<tbody>"
" <tr >"
"<td style='border: 1px solid;padding:10px;font-size:13px;'>Sample Company</td>"
"<td style='border: 1px solid;padding:10px;font-size:13px;'>03-15-2018</td>"
"<td style='border: 1px solid;padding:10px;font-size:13px;'>02-14-2019</td>"
"<td style='border: 1px solid;padding:10px;font-size:13px;'>6 months</td>"
"<td style='border: 1px solid;padding:10px;font-size:13px;'>1 year</td>"
"</tr>"
"<tbody>"
"</table>"
" </p>"})
template_rec.write(values)
template_rec.send_mail(con.id, force_send=True)
0
Avatar
Buang
Your Dad

use "t-foreach"

Avatar
Eman Abdulmalik
Jawaban Terbai

Hello,


Use the following to loop through objects. Lets say the field you want to loop is called "lines":

The below will loop through all the field lines and output the value of the name field.


% for row in object.lines:

            <td> Deposit : ${row.name}</td>

            % endfor

0
Avatar
Buang
Avatar
Ermin Trevisan
Jawaban Terbai

You may want to use a QWeb template and read the documentation: https://www.odoo.com/documentation/12.0/reference/qweb.html#loops

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
I Can't edit my email template header and footer ? Diselesaikan
email email_template
Avatar
Avatar
Avatar
Avatar
3
Des 24
6363
Send email with template
email send
Avatar
3
Jan 20
6285
emai_from in Email Template Ignored
email email_template
Avatar
0
Okt 15
4498
Adding cc column in mail.compose.message
email send
Avatar
Avatar
1
Mar 15
10719
Emailing Invoices don't go to or by the right person
email invoicing email_template
Avatar
0
Sep 25
748
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