Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita 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
  • Proyectos
  • 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

[SOLVED] How to add field into Quotation/Sale Order (pdf)

Suscribirse

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

Se marcó esta pregunta
2 Respuestas
20017 Vistas
Avatar
Dr Obx

Guys,

I would like to add a field into the Quotation/Sale Order so I added it into report_saleorder.xml but either it's not correct place or I did something wrong.

Where should I add it to have it on printouts ?

0
Avatar
Descartar
Avatar
William Brugger
Mejor respuesta

First you need to create the fields you want to add.  You can do this in developer mode (http://pulse7.net/openerp/odoo-9-how-to-activate-developer-mode/) or create your own module. (https://www.odoo.com/documentation/8.0/howtos/backend.html#build-an-odoo-module)

Developer Mode:  Go to settings->technical->models and search for sale.order.  Once you are on the sale model you can edit and add a field.  It is good practice to name your field with the prefix "x_"  (i.e. "x_mycustomfield")  Use other fields as a means to determine what type of data (Field Type) you should choose. (i.e. char, integer, datetime etc).

Now that you have added your field you can now add it to the qweb view of the report.    The one you will want to edit is "report_saleorder_document".  FYI, the way to find the correct qweb views for any report is as follows:

Go to  settings->technical->reports and search for the model (i.e. sale.order.)  Open that and look click the link "search associated qweb views".  


Once you have opened report_saleorder_document you can edit in your custom field.  For example, if you wanted to add your field right after Unit Price you would look for

<th class="text-right">Unit Price</th> 

and add

<th class="text-right">My Custom Field</th>

Then look below for

<td class="text-right">
<span t-field="l.price_unit"/> </td>

and add right after

<td class="text-right">
<span t-field="l.x_mycustomfield"/> </td>    


If you get an error when saving it may be that your custom field is not registered yet or misspelled.

The better way to do this is with a custom module.  It's not too hard to do and there are several good tutorials.  You will need to search for how to create custom modules that extend models and how to create custom reports or modify reports.


Also, as the previous answer indicated, you can also easily add your custom field to the tree and form views if desired.  As long as you are in developer mode just go to sales->sales orders and  on the bottom of the window click view-edit tree view or if you click on an order you can click view -> edit form view.  Use the existing fields as an example of how to add your field.  It's a little different than the qweb.


Have fun.

2
Avatar
Descartar
Dr Obx
Autor

Great thanks Will, works beautifully.

Dr Obx
Autor

I was so close ... :)

Avatar
Koffi KPONOUGLO
Mejor respuesta

Hi Dr Obx,

it is depend of your gool. Classicly you can follow these step : 

  1. Add the field into sale.py in object sale.order.

  2. Add the field into sale_view.xml (form and tree view of sale.order)

  3. Add the field into report_saleorder.xml


Good work

1
Avatar
Descartar
Dr Obx
Autor

Before I posted my question I already did the steps you suggested but I cant see my custom field. Actually I can see my field but only on screen, I can't see it in PDF/printout

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

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

Registrarse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • 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 estar totalmente integrado.

Sitio web hecho con

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