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
    • Discuss
    • 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

Writing values to only one field from a model to use it in qweb reporting

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
account.move.lineodoo12Odoo12.0
1 Balas
5688 Tampilan
Avatar
Yaser


I build a model from scratch and I need to build a report for only some fields.

The problem is that each job(field i called it : name) from my model has many debits in the 'account.move.line' model, however it is not a (many2one or one2many relation), I have checked that a list resulted from a method in my model is having what I am looking for, however I have a problem in displaying it in the qweb fromat, so I decided to insert this list in a new field in my model called debitx, but nothing change.

here is my method code:

 @api.multi
def _get_debit(self):

       total_len = self.env['account.move.line'].search([('analytic_account_id', '=', self.name)])
       l = []

       for item in total_len:
           item=item['debit']

           l.append(item)

       records = self.env['transfer.jobs']

       for i in l:
           records.write({'debitx':i})

the _get_debit method is inside my new (compute) field called debitx, this method is a member of my manage.job model.


and her is my report :

<?xml version="1.0"?>

<odoo> <report id="action_library_book_report"
string="JOBS REPORT"
model="transfer.jobs" report_type="qweb-pdf"
name="job_management.report_library_book_template" />



<template id="report_library_book_template">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">

<!-- Report header content -->
<div class="container">
<div class="row bg-primary">
<div class="col-3">JOB NO.</div>
<div class="col-2">Customer</div>

<div class="col-2">Debit</div>
<div class="col-2">Credit</div>
<div class="col-2">Balance</div>




</div>

<t t-foreach="docs" t-as="line">

<div class="row">
<!-- Report Row Content -->
<div class="col-3">
<h4><span t-field="line.name" /></h4>
</div>
<div class="col-2">
<span t-field="line.customer" />
</div>

<div class="col-2">
<span t-field="line.debitx"/>

</div>






<div class="col-2">
<!-- Render Authors -->
</div>
</div>


</t>
<!-- Report footer content ...-->
</div>


<t t-foreach="docs" t-as="o">
<!-- Report row content -->
</t>
<!-- Report footer content -->
</div>
</t>
</t>
</template>


</odoo>


Any suggestions, or how to create a qweb report from only lists returned by methods.

0
Avatar
Buang
Avatar
Eman Abdulmalik
Jawaban Terbai

Hello,

Which transfer jobs are you writing it to?

When you are printing a transfer jobs report you are printing a record with a specific id, here to what specific record are you trying to write it.


Lets say you are printing a record with id 29 - you have to have a debix field written to a record with id 29.


Also the debitx value is being overwritten, it will have the last value in the loop. If you want to have all the values in the loop, use something like join.


",".join(l)

The above will join the l value to a string separated by a comma - you can use this considering you are using debitx as a text or a char field.

records = self.env['transfer.jobs']

       for i in l:
           records.write({'debitx':i})
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
How can i modify web.assets_frontend.0.css ?
rtl odoo12 Odoo12.0
Avatar
Avatar
2
Nov 19
10111
Cannot create a record in stock.move model
error stock_move odoo12 Odoo12.0
Avatar
Avatar
1
Jan 20
6504
Get invoice lines in custom form in Odoo 12 Diselesaikan
invoicing invoice.line odoo12 Odoo12.0
Avatar
Avatar
1
Nov 19
6646
Which version of summernote editor is patched with odoo 12?
odoo odoo12 odoo12.0 Odoo12.0
Avatar
Avatar
2
Des 18
5434
Create Module on Odoo 12 won't to show link to access Diselesaikan
Module odoo12 odoo12.0 Odoo12.0
Avatar
Avatar
Avatar
5
Nov 18
9144
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