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

Method Subtotal

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
2 Replies
4415 Tampilan
Avatar
yusuf

hi all,

I have a problem hearts Making subtotal method , the method for Only thing I can last column displays the data in Saja NOT want to add BETWEEN column 1 and column 2 , I 've Tried differences Only the results are still the same and this is the method that I created

 

def _get_total(self,a):
        total =0
        for o in a :
            total +=(o['cost_spare_part'] *o['jumlah'])
            print "ini total=================>>>>>>>>>>",total

        return total

0
Avatar
Buang
Akhil P Sivan

Hi Akhil P Sivan [1] A variable is the name of the table on parts_lines or a = parts_lines in this parts_lines table I want to take the price of spare parts and the number but when I took the price ( standard_price ) that are on the object , but when I took my product.product standard_price even error a ={'jumlah': 2.0, 'asset_name': u'Kendaraan', 'plat_no': u'A 2338 AB', 'asset_no': u'1.11 Asset', 'tindakan': False, 'pelaksana': False, 'satuan': u'Unit(s)', 'permasalahan': u'as', 'spare_part': u'ban', 'tanggal': '2015-01-28 06:55:11', 'cost_spare_part': 50000.0} of the answer that you gave no error occurs, the error like this : for o in self : TypeError: 'history_maintenance' object is not iterable [1] https://www.odoo.com/forum/help-1/user/336884

Zbik

How and where you call _get_total?

yusuf
Penulis

The method to call formatLang (get_total (o)) and this for at RML (report)

Akhil P Sivan

Hi Yusuf, I made a change in the answer. Please try like that. Are you can calling the 'part_lines' field as one2many from any other object? Where you want to get the 'total_cost' value returning from the function?

Avatar
Akhil P Sivan
Jawaban Terbai

Hi Yusuf,

 

Try like this:

 

def _get_total(self,a):
        total =0
        total += a.cost_spare_part * a.jumlah
        print "ini total=================>>>>>>>>>>",total

   return total

2
Avatar
Buang
yusuf
Penulis

Hi Akhil P Sivan, I already use the method that you created but in the method you created there is an error and this error mean what ? and this error : total +=a.cost_spare_part * a.jumlah AttributeError: 'dict' object has no attribute 'cost_spare_part'

Avatar
Zbik
Jawaban Terbai

If call is formatLang (get_total (o)), then o is main object of report, in this case you try:

for line in a.part_lines :
  total +=line.cost_spare_part * line.jumlah

What is your o? and how you use and define parts_lines in model and report?

UPDATE:

Try this, in RML;

formatLang (get_total (line(data))

and in code:

for line in a:
  total +=line.cost_spare_part * line.jumlah

or....  total +=line['cost_spare_part'] * line['jumlah']

0
Avatar
Buang
yusuf
Penulis

Hi zbik, I already use the method that you created but in the method you created there is an error and this error mean what ? and this error : for line in a.part_lines : AttributeError: 'dict' object has no attribute 'part_lines'

yusuf
Penulis

this is rml in subtotal

[[repeatIn(line(data) ,'o')]] [[ no_urut() ]] [[ formatLang(o['tanggal'], date=True) ]] [ [[ o['asset_no'] ]] ] [[ o['asset_name'] ]] [[ o['plat_no'] ]] [[ o['permasalahan'] ]] [[ o['tindakan'] ]] [[ o['spare_part'] ]] [[ formatLang(o['cost_spare_part']) ]] [[ o['jumlah'] ]] [[ o['satuan'] ]] [[ formatLang(get_biaya(o)) ]] [[ o['pelaksana'] ]]
Subtotal [[ formatLang(get_total(o)) ]] .

Zbik

[[repeatIn(line(data) ,'o')]] ..... in this case "o" is only one line. It can not work. A list "o" is needed. What is the structure of the variable "data"?

yusuf
Penulis

How to " o " could work because our time line in the loop for o.parts_lines then there is an error for the line in o.parts_lines object has no attribute Parts_lines

Zbik

answer updated

yusuf
Penulis

how because I 've had some time messing about with " for " the result is still the same

Zbik

If line(data) return list? and in RML you use formatLang (get_total(line(data)) it should work.

yusuf
Penulis

Hi zbik, thank you for helping me and the advice you give it turns out to work and once again I thank you , if I may be asked for your email ?

yusuf
Penulis

Hi zbik, I have questions about the report in Excel, this is the case if we take the data period 1 then naturally arises automatically period to 1 but if you want to choose the period to 2 then automatically also the emergence of the period to 2, if for example, want to bring up the data period 1 in period 2?

Zbik

My email: darek@krokus.com.pl. I do not understand the last issue and additionaly what is the structure of your code and data.

yusuf
Penulis

data record in period

Menikmati diskusi? Jangan hanya membaca, ikuti!

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

Daftar
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