Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Problem with creating printing

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
errorprintingproblem
3 Réponses
4907 Vues
Avatar
Matthieu

Hello,


I'm currently creating an Odoo 9 module and I've got this view :

http://i.imgur.com/FK6GhFO.png

When you click on the print button, I've got this error :

File "/opt/odoo/openerp/addons/base/ir/ir_model.py", line 972, in xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % (xmlid))
ValueError: External ID not found in the system: coupon.report_invoice

My code is composed by two things :

-> A report :

<report

    id="report_coupon"

    model="report.coupon"

    string="Coupons"

    report_type="qweb-pdf"

    name="coupon.report_invoice"

    file="coupon.report_invoice"

    attachment_use="True"

    attachment="(object.state in ('open','paid')) and

          ('INV'+(object.number or '').replace('/','')+'.pdf')"

/>

-> A python class :

class CouponReport(models.Model):

_name = 'report.coupon'

    def render_html(self, cr, uid, ids, data=None, context=None):

       report_obj = self.pool['report']

       report = report_obj._get_report_from_name(

          cr, uid, 'coupon'

       )

       docargs = {

          'doc_ids': ids,

          'doc_model': report.model,

          'docs': self.pool[report.model].browse(

             cr, uid, ids, context=context

          ),

       }

       return report_obj.render(

           cr, uid, ids, 'coupon',

           docargs, context=context

       )

I don't understand what is wrong with my code.

Please, help me !

Thanks in advance for you help.

0
Avatar
Ignorer
Avatar
Nicolas JEUDY
Meilleure réponse

Hello, 

- Is "coupon" the name of your module ?

- can you share the complete traceback ?

# With your info:

Add a method on your model

@api.multi 
def coupon_print(self):  
self.ensure_one()
return self.env['report'].get_action(self, 'loyalty.report_coupon')

Next add an action in xml file

<template id="report_coupon"> 
 <t t-call="report.html_container">
 <t t-foreach="docs" t-as="o">
 <t t-call="loyalty.report_coupon_document" t-lang="o.partner_id.lang"/> </t> </t> </template>


- report_coupon_document is your document template

- loyalty is the name of the module (for correct xml_id)

- report_coupon is the name on the report action in XML

0
Avatar
Ignorer
Matthieu
Auteur

Hello, thanks for your help ! My module name is "loyalty". The complete traceback is here : http://pastebin.com/88XYHsJ9

Matthieu
Auteur

I'm trying to print coupons, but I'm trying to use the invoice print option to understand how it works, and I think it's the problem. Thanks for your help.

Matthieu
Auteur

Well, thank you. I tried what you've sent but now, nothing append. I tried to see if the coupon_print(self) function was read, with _logger.info(), but it's currently not the case.

Nicolas JEUDY

can you share je python code .. coupon print should be launched by you print button on the form .. I think you missed to change the name or action of this button.

Matthieu
Auteur

I modified some things to integrate the CouponReport class to my loyalty_coupon class and all the code is here : http://pastebin.com/hjMeBKBr Thank you so much !

Matthieu
Auteur

But it doesn't work (I think it was a little bit ambiguous)

Avatar
Qutechs, Ahmed M.Elmubarak
Meilleure réponse

Hello,

Try to use:

 id="report_invoice"

instead of  id="report_coupon"
in the report tag

0
Avatar
Ignorer
Matthieu
Auteur

hello, When I do this, the problem is the same. nothing changed in the error.

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
{Solved} Printing error: TypeError: this.contentDocument is null Résolu
error printing wkhtmltopdf
Avatar
1
déc. 23
9550
Error when exporting/printing invoice
invoice error printing Exporting
Avatar
Avatar
Avatar
3
nov. 23
10029
OpenERP Client Error - Uncaught SyntaxError: Unexpected end of input // What does that mean? Résolu
error print printing syntax
Avatar
Avatar
Avatar
Avatar
Avatar
7
déc. 23
18226
Error loading all PDF reports in v8
pdf v8 error printing
Avatar
0
mars 16
4286
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
nov. 25
592
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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