Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

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

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

When i click on Print Button RML get error

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
developmenterrorrml
1 ตอบกลับ
6473 มุมมอง
อวตาร
Harsh Dhaduk

Hello, Friends

i created one module testing purpose to generate blank pdf file to open. but something i missed and when i press print button then error come

so can you help me how can i fix.

Thanks In Advance

Error Come Like This

report.hd.wizard

type 'exceptions.KeyError', KeyError(u'report.hd.wizard', traceback object at 0xc9b6b44

directory structure like this

hd_report

  • __init__.py
  • __openerp__.py
  • hd_wizard.py
  • hd_wizard_view.xml
  • report 1.__init__.py 2.hd_report.py 3.hd_report.rml 4.hd_r

eport.sxw

1)__init__.py

import  hd_wizard

2)__openerp__.py

{
     'name': 'HD Report Wizard',
     'version': '1.0',
     'category': 'General',
    'author': 'Harsh Dhaduk',
    'depends': ['sale', 'point_of_sale'],
    'data': [ "hd_wizard_view.xml" ],
    'installable': True,   
    'active': False,

}

3)hd_wizard.py

from openerp.osv import fields, osv from openerp.tools.translate import _ import time

class hd_wizard(osv.osv_memory):
    _name = "hd.wizard"

    def get_start_date(self, cr, uid, context=None):
        start_date = time.strftime('%Y') + '-01-01'
        return start_date

    _columns = {
        'start_date': fields.date('Start Date',

required=True), 'end_date': fields.date('End Date', required=True), 'all_shops': fields.boolean('All Shops'), 'shop_ids': fields.many2many('sale.shop', 'rel_wizard_shop', 'wizard_id', 'shop_id', 'Shops'), } _defaults = { 'start_date': get_start_date, 'end_date': time.strftime('%Y-%m-%d'), }

    def print_report(self, cr, uid, ids, context=None):
        record = self.read(cr, uid, ids[0], context=context)
        datas = {
             'model': 'hd.wizard',
             'ids': ids,
             'form': record,
        }
        return {
            'type': 'ir.actions.report.xml',
            'report_name': 'hd.wizard',
            'datas': datas,
            'nodestroy': True            
        }

hd_wizard()

4) hd_wizard_view.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="view_hd_wizard_form" model="ir.ui.view">
            <field name="name">view.hd.wizard.form</field>
            <field name="model">hd.wizard</field>
            <field name="arch" type="xml">
                <form string="HD Report Wizard" version="7.0">
                    <group col="4" colspan="4">
                        <field name="start_date"/>
                        <field name="end_date"/>
                    </group>
                    <group col="4" colspan="4">
                        <field name="all_shops"/>
                    </group>
                    <group colspan="4">
                        <field name="shop_ids" nolabel="1" attrs="{'readonly': [('all_shops', '=', True)]}"/>
                    </group>
                    <footer>
                        <button name="print_report" string="Print" type="object" class="oe_highlight"/>
                        <button string="Cancel" class="oe_link" special="cancel"/>
                    </footer>
                </form>
           </field>
        </record>

        <record id="action_hd_wizard" model="ir.actions.act_window">
            <field name="name">HD Wizard</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">hd.wizard</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="target">new</field>
            <field name="view_id" ref="view_hd_wizard_form"/>
        </record>

        <menuitem action="action_hd_wizard" id="menu_hd_wizard" 
                  parent="base.next_id_64"/>

        <report
            auto="False"
            id="hd_report_custome"
            model="hd.wizard" 
            name="hd.report"
            rml="hd_report/report/hd_report.rml"
            string="Custome Report ..." 
            header="False"/>

    </data>
</openerp>

5)report->__init__.py

import hd_report

6)report->hd_report.py

import time
from common_report_header import common_report_header
from openerp.report import report_sxw

class hd_report(report_sxw.rml_parse, common_report_header):
    def __init__(self, cr, uid, name, context):
        super(hd_report, self).__init__(cr, uid, name, context)
        self.localcontext.update({

        })

report_sxw.report_sxw('hd.report', 'hd.wizard', 'addons/hd_report/report/hd_report.rml', parser = hd_report,header="external")
1
อวตาร
ละทิ้ง
อวตาร
Jagdish Panchal
คำตอบที่ดีที่สุด

Hi,

import report in your main 1) __init__.py file

Hope this will help you

1
อวตาร
ละทิ้ง
Harsh Dhaduk
ผู้เขียน

i tried but same error come report.hd.wizard type 'exceptions.KeyError', KeyError(u'report.hd.wizard', traceback object at 0xc9b6b44

Jagdish Panchal

Try this: report_sxw.report_sxw('report.hd.report', 'hd.wizard', 'addons/hd_report/report/hd_report.rml', parser = hd_report,header="external")

สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
RML report display problem?
development rml
อวตาร
0
มี.ค. 15
4387
safe_eval:cannot eval fuctions.. warning for RML
error rml purchase_order
อวตาร
0
มี.ค. 15
6287
How do I deal with the "Invalid XML for View Architecture!" error?
development error view
อวตาร
อวตาร
อวตาร
2
มี.ค. 15
7783
How To Hide User Group From Users Form View In Odoo
development error users group
อวตาร
อวตาร
อวตาร
อวตาร
4
ก.ย. 25
2622
odoo 15 development error
development error v15 psycopg2.errors
อวตาร
อวตาร
1
ก.ค. 24
4719
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة 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 เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ 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