Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

When i click on Print Button RML get error

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
developmenterrorrml
1 Rispondi
6434 Visualizzazioni
Avatar
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
Avatar
Abbandona
Avatar
Jagdish Panchal
Risposta migliore

Hi,

import report in your main 1) __init__.py file

Hope this will help you

1
Avatar
Abbandona
Harsh Dhaduk
Autore

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")

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
RML report display problem?
development rml
Avatar
0
mar 15
4354
safe_eval:cannot eval fuctions.. warning for RML
error rml purchase_order
Avatar
0
mar 15
6230
How do I deal with the "Invalid XML for View Architecture!" error?
development error view
Avatar
Avatar
Avatar
2
mar 15
7754
How To Hide User Group From Users Form View In Odoo
development error users group
Avatar
Avatar
Avatar
Avatar
4
set 25
2589
odoo 15 development error
development error v15 psycopg2.errors
Avatar
Avatar
1
lug 24
4695
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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