Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Explorar todos los sectores
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Servicios para partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

adding custom field in quotation/invoice

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
salespdf
1 Responder
565 Vistas
Avatar
L Scales , LScales

i want to add a custom field in a quotation and fill it manually each time then it appears in the pdf when i create an invoice

0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

Hi,


Step 1: Create the Custom Field in the sale.order Model


Activate developer mode and create a custom module (if you don't have one). In your custom module's models/sale_order.py file, add a new field to the sale.order model using _inherit. Define the field with an appropriate type (e.g., fields.Text for multi-line text), a descriptive string for the label, and set store=True to ensure the field is stored in the database.


from odoo import models, fields, api


class SaleOrder(models.Model):

    _inherit = 'sale.order'


    x_custom_field = fields.Text(string="Your Custom Field", store=True)


Step 2: Add the Field to the Quotation Form View


In your custom module's views/sale_order_views.xml file, create a view inheritance to modify the existing quotation form view. Use an xpath expression to specify where to insert the new field in the form. Add the <field name="x_custom_field"/> tag to include the custom field in the form view.


<odoo>

        <record id="sale_order_form_custom_field" model="ir.ui.view">

            <field name="name">sale.order.form.custom.field</field>

            <field name="model">sale.order</field>

            <field name="inherit_id" ref="sale.view_order_form"/>

            <field name="arch" type="xml">

                <xpath expr="//notebook/page[@name='other_information']/group" position="inside">

                    <field name="x_custom_field"/>

                </xpath>

            </field>

        </record>

</odoo>


Step 3: Update the Module


Go to the Apps module in Odoo and update your custom module. This will install the new field and view changes, making the custom field visible in the quotation form.


Step 4: Add the Field to the Invoice PDF Report


Identify the ID of the invoice PDF report template (e.g., account.report_invoice_document). In your custom module's views/report_invoice_views.xml file, create a view inheritance to modify the report template. Use an xpath expression to specify where to insert the custom field in the PDF report. Add the necessary HTML and QWeb code to display the custom field's label and value in the PDF.


<odoo>

        <template id="report_invoice_document_custom_field" inherit_id="account.report_invoice_document">

            <xpath expr="//div[@class='page']/div[@class='row mt20']" position="inside">

                <div class="col-auto mw-100 mb-2">

                    <strong>Your Custom Field:</strong>

                    <p t-field="o.x_custom_field"/>

                </div>

            </xpath>

        </template>

</odoo>


Step 5: Update the Module


Go to the Apps module and update your custom module. This will install the new report view changes, ensuring that the custom field appears in the generated invoice PDFs.


Hope it helps

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
How to achieve the effect shown in the image? The video is from the official channel: 2 Minutes to Understand Odoo
sales pdf
Avatar
0
nov 25
209
Odoo 18 Quotation Builder Header/Footer Print Problem Resuelto
sales pdf
Avatar
Avatar
2
ago 25
4647
Digital products
sales pdf
Avatar
Avatar
1
feb 25
8155
How to hide units of measure in PDF reports?
sales debug pdf
Avatar
Avatar
Avatar
3
oct 25
734
How to keep footer always at the bottom of the very last page in QWeb PDF report
sales debug pdf
Avatar
Avatar
Avatar
2
ago 25
1383
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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