Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Problem with creating printing

Odebírat

Get notified when there's activity on this post

This question has been flagged
errorprintingproblem
3 Odpovědi
4918 Zobrazení
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
Zrušit
Avatar
Nicolas JEUDY
Nejlepší odpověď

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
Zrušit
Matthieu
Autor

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

Matthieu
Autor

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
Autor

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
Autor

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
Autor

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

Avatar
Qutechs, Ahmed M.Elmubarak
Nejlepší odpověď

Hello,

Try to use:

 id="report_invoice"

instead of  id="report_coupon"
in the report tag

0
Avatar
Zrušit
Matthieu
Autor

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

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
{Solved} Printing error: TypeError: this.contentDocument is null Vyřešeno
error printing wkhtmltopdf
Avatar
1
pro 23
9559
Error when exporting/printing invoice
invoice error printing Exporting
Avatar
Avatar
Avatar
3
lis 23
10036
OpenERP Client Error - Uncaught SyntaxError: Unexpected end of input // What does that mean? Vyřešeno
error print printing syntax
Avatar
Avatar
Avatar
Avatar
Avatar
7
pro 23
18230
Error loading all PDF reports in v8
pdf v8 error printing
Avatar
0
bře 16
4292
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
lis 25
592
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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