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
    • Manajemen Properti
    • 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
    • Tanya ahli
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan
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

print button code doubt

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
printreportclassreport.sxw
2 Replies
5415 Tampilan
Avatar
sneha antony

I had a doubt regarding the .py code to print a report.For purchase order the code in the .py file is being provided below.But I didn't understand the last line report_sxw.report_sxw('report.purchase.order','purchase.order','addons/purchase/report/order.rml',parser=order).

class order(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(order, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({'time': time})

report_sxw.report_sxw('report.purchase.order','purchase.order','addons/purchase/report/order.rml',parser=order)

How is purchase.order given in that line.What is its significance and where is it taken from?The class name is order yet the report.sxw is given the name purchase.order.Can anyone please give me a clarification.

0
Avatar
Buang
Prakash

please see the link https://doc.openerp.com/6.0/developer/3_11_reports/11_1_openoffice_report/

sneha antony
Penulis

Can you please give explanation for the purchase.order given in report_sxw

Avatar
Prakash
Jawaban Terbai

The parser inherit from the report_sxw.rml_parse object and it add to the localcontext, the function time so it will be possible to call it in the report.

After an instance of report_sxw.report_sxw is created with the parameters

  1. the name of the report
  2. the object name on which the report is defined
  3. the path to the rml file
  4. the parser to use for the report (by default rml_parse)
  5. a boolean to add or not the company header on the report (default True)

report_sxw The second parameter is object name 'purchase.order' for Purchase Module

from openerp.report import report_sxw File Location server\server\openerp\report\report_sxw.py

1
Avatar
Buang
Avatar
René Schuster
Jawaban Terbai

As prakash suggested: See this for clarification.

order is a custom parser that inherits from report_sxw.rml_parse.
The __ini__ function is overridden to give access to the time via the localcontext.

From the given link above:

After, an instance of report_sxw.report_sxw is created with the parameters:
- the name of the report
- the object name on which the report is defined
- the path to the rml file
- the parser to use for the report (by default rml_parse)
- a boolean to add or not the company header on the report (default True)

If you check the code of report_sxw.report_sxw you will find the definition of its __init__ function:

class report_sxw(report_rml, preprocess.report):
def __init__(self, name, table, rml=False, parser=rml_parse, header='external', store=False):
    report_rml.__init__(self, name, table, rml, '')
    self.name = name
    self.parser = parser
    self.header = header
    self.store = store
    self.internal_header=False
    if header=='internal' or header=='internal landscape':
        self.internal_header=True

There you can see what the documentation already told you: The second argument is the table/model/object on which you create the report.
In your case 'purchase.order'. It has nothing to do with the name of the parser; this is the fourth argument.

Regards.

0
Avatar
Buang
sneha antony
Penulis

I tried the code for printing in the warranty module.But on clicking the print button error occurs that

AttributeError: 'warranty_warranty' object has no attribute '%(collection_docket)d'

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 to check if report has been printed
print report
Avatar
Avatar
1
Nov 16
5716
How to generate barcode for sequence and display in report in Odoo? Diselesaikan
print barcode report
Avatar
Avatar
Avatar
2
Feb 24
16158
how to print a custom report in openerp Diselesaikan
print report button
Avatar
Avatar
1
Okt 22
7128
Print 2 reports at the end of code execution from a different action button
print report odoo12.0
Avatar
Avatar
1
Agu 21
5275
Getting error in print report - enterprise V13
print report website
Avatar
0
Jul 21
3208
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
  • Karir
  • 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 Svenska ภาษาไทย 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