İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Print Button in New Model

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
salesfunctionpdf
3 Cevaplar
1498 Görünümler
Avatar
Óptica Marcopolo

Hola, buenas tardes. Agregué una nueva plantilla a mi módulo de ventas, basada en el diseño del presupuesto, pero orientada a un certificado específico que requiere nuestra empresa. Busco información sobre cómo activar las opciones de impresión o guardar como PDF dentro de esta plantilla. Les agradecería mucho su ayuda.


​

0
Avatar
Vazgeç
Avatar
Piyush H
En İyi Yanıt

¡Hola! Entiendo que has creado una nueva plantilla de impresión en tu módulo de ventas y quieres habilitar las opciones de impresión y guardar como PDF. Aquí te explico cómo hacerlo:

Pasos para Activar la Impresión y Guardar como PDF

El proceso general implica definir un "report action" en Odoo y asociarlo a tu modelo. Aquí te detallo los pasos:

  1. Crear un Report Action (Acción de Reporte) en XML:
    • Dentro de tu módulo, crea o edita un archivo XML (por ejemplo, views/report_views.xml).
    • Define un ir.actions.report record. Este record le dice a Odoo cómo generar el PDF.
    <odoo>
        <data>
            <report
                id="action_report_mi_certificado"
                model="tu.modelo"  <!-- Reemplaza con el nombre de tu modelo -->
                string="Imprimir Certificado"
                report_type="qweb-pdf"
                name="tu_modulo.reporte_mi_certificado_template"  <!-- Reemplaza con el nombre de tu template -->
                file="tu_modulo.reporte_mi_certificado"  <!-- Reemplaza con el nombre del archivo base -->
                print_report_name="'Certificado - %s' % (object.name)"  <!-- Opcional: Nombre del archivo PDF -->
                binding_model_id="ref('model_tu_modelo')"  <!-- Reemplaza con la referencia al modelo -->
                binding_type="report"
            />
        </data>
    </odoo>
    
    Explicación de los campos:
    • id: Un identificador único para tu report action.
    • model: El nombre del modelo al que pertenece este reporte (ej., sale.order, tu.modelo). Reemplaza tu.modelo con el nombre real de tu modelo.
    • string: El texto que aparecerá en el menú de impresión (ej., "Imprimir Certificado").
    • report_type: qweb-pdf indica que estás usando QWeb para generar el PDF.
    • name: El nombre técnico del reporte. Sigue la convención tu_modulo.nombre_del_template. Reemplaza tu_modulo.reporte_mi_certificado_template con el nombre correcto de tu template QWeb.
    • file: El nombre base del archivo PDF generado. Sigue la convención tu_modulo.nombre_del_archivo. Reemplaza tu_modulo.reporte_mi_certificado con un nombre apropiado.
    • print_report_name: (Opcional) Define el nombre del archivo PDF que se descargará. Puedes usar expresiones Python para hacerlo dinámico (ej., incluir el nombre del cliente). object se refiere al registro actual.
    • binding_model_id: Una referencia al modelo al que se asocia el reporte. Necesitas crear una referencia al modelo en XML.
    • binding_type: report indica que este es un reporte imprimible.
  2. Crear una Referencia al Modelo (si no existe):
    • Si no tienes una referencia a tu modelo en XML, necesitas crearla. Esto se hace en el mismo archivo XML (views/report_views.xml o donde prefieras).
    <record id="model_tu_modelo" model="ir.model">
        <field name="model">tu.modelo</field>  <!-- Reemplaza con el nombre de tu modelo -->
        <field name="name">Tu Modelo</field>  <!-- Reemplaza con un nombre legible para tu modelo -->
    </record>
    
    • Reemplaza tu.modelo con el nombre real de tu modelo.
    • Reemplaza "Tu Modelo" con un nombre descriptivo para tu modelo.
  3. Asegurarte de que tu Template QWeb Existe:
    • Tu template QWeb (el archivo que define el diseño del reporte) debe existir y tener el nombre correcto (el que usaste en el campo name del report action).
    • El template debe estar en un archivo XML (ej., views/report_templates.xml).
    <template id="reporte_mi_certificado_template">
        <t t-call="web.html_container">
            <t t-call="web.external_layout">
                <div class="page">
                    <!-- Aquí va el contenido de tu certificado -->
                    <h1>Certificado</h1>
                    <p>Este es un certificado para: <t t-esc="object.name"/></p>
                </div>
            </t>
        </t>
    </template>
    
    Explicación:
    • id: El identificador único del template. Debe coincidir con el nombre que usaste en el name del report action (ej., tu_modulo.reporte_mi_certificado_template).
    • <t t-call="web.html_container"> y <t t-call="web.external_layout">: Estos templates proporcionan la estructura HTML básica para el reporte (encabezado, pie de página, etc.).
    • <div class="page">: Define una página en el reporte.
    • <t t-esc="object.name"/>: Imprime el valor del campo name del registro actual. object se refiere al registro que estás imprimiendo.
  4. Incluir los Archivos XML en el __manifest__.py:
    • Asegúrate de que los archivos XML que creaste (ej., views/report_views.xml y views/report_templates.xml) estén listados en el data del archivo __manifest__.py de tu módulo.
    {
        'name': 'Mi Módulo de Certificados',
        'version': '1.0',
        'depends': ['sale'],
        'data': [
            'views/report_views.xml',
            'views/report_templates.xml',
        ],
        'installable': True,
        'application': False,
    }
    
  5. Actualizar el Módulo:
    • Después de hacer estos cambios, actualiza tu módulo en Odoo para que los cambios surtan efecto. Ve a la lista de aplicaciones, busca tu módulo y haz clic en "Actualizar".

Cómo Usar la Impresión

Una vez que hayas hecho esto, deberías ver una opción de "Imprimir Certificado" (o el texto que hayas puesto en el campo string del report action) en el menú "Imprimir" (Print) de tu modelo. También deberías poder guardar el reporte como PDF.

Consejos Adicionales

  • Diseño del Reporte: Usa CSS para diseñar tu reporte QWeb. Puedes incluir CSS directamente en el template o enlazar a un archivo CSS externo.
  • Imágenes: Para incluir imágenes en tu reporte, puedes usar la función base64 para codificar la imagen en el XML o usar un enlace a una imagen externa.
  • Depuración: Si tienes problemas, revisa los logs de Odoo para ver si hay errores. También puedes usar el debugger de Python para depurar tu template QWeb.


🚀 Did This Solve Your Problem?

If this answer helped you save time, money, or frustration, consider:

✅ Upvoting (👍) to help others find it faster

✅ Marking as "Best Answer" if it resolved your issue

Your feedback keeps the Odoo community strong! 💪

(Need further customization? Drop a comment—I’m happy to refine the solution!)


0
Avatar
Vazgeç
Avatar
Óptica Marcopolo
Üretici En İyi Yanıt

Thank you very much, I will add it

0
Avatar
Vazgeç
Avatar
Cybrosys Techno Solutions Pvt.Ltd
En İyi Yanıt

Hi, 


To print your custom template, you must create a menu item in Odoo that links to your model and view. This involves defining a menu, an action (typically a window action), and associating that action with a specific model and view.


Menu Action

<record id="action_report_sale_template" model="ir.actions.report">
<field name="name">Sale Report </field>
<field name="model">sale.order</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">module_name.your_template_id</field>
<field name="report_file">module_name.your_template_id</field>
<field name="binding_model_id" ref="sale.model_sale_order"/>
<field name="binding_type">report</field>
</record>

Template


<template id="your_template_id">
<xpath expr="//t[@t-call='web.external_layout']" position="replace">
<t t-call="web.html_container">
#
#
#
#
#
#
</t>
</xpath>
</template>


Hope it helps

0
Avatar
Vazgeç
Enjoying the discussion? Don't just read, join in!

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
adding custom field in quotation/invoice
sales pdf
Avatar
Avatar
1
Kas 25
430
Odoo 18 Quotation Builder Header/Footer Print Problem Çözüldü
sales pdf
Avatar
Avatar
2
Ağu 25
4488
Digital products
sales pdf
Avatar
Avatar
1
Şub 25
8062
How to hide units of measure in PDF reports?
sales debug pdf
Avatar
Avatar
Avatar
3
Eki 25
602
How to keep footer always at the bottom of the very last page in QWeb PDF report
sales debug pdf
Avatar
Avatar
Avatar
2
Ağu 25
1287
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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