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

CSS styling not completely working in QWeb Reports

Suscribirse

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

Se marcó esta pregunta
qwebreporttemplatecssodoo8
3 Respuestas
22920 Vistas
Avatar
Shawn Varghese

I am creating a custom QWeb report, but I find that when using t-field, not all CSS styling is reflected.

For e.g.

<div class="col-xs-8 text-right"
                             style="color:green;font:italic 14px lucida-console, sans-serif"
                             t-field="company.partner_id"
                             t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true }' />

The output is in 14px Lucida-Console text, but it is not italic nor green!

I tried including "style":"color:green;font:italic 14px lucida-console, sans-serif" inside t-field options, but there is no difference. How do I have to code to reflect all styling?

1
Avatar
Descartar
Avatar
Shawn Varghese
Autor Mejor respuesta

Thank you both for your inputs. But even after using !important, it didn't work. I did notice that if I remove t-field-options, then the formatting applies correctly. So I'm not sure what exactly is causing the problem. For now, I have resolved it by displaying each property separately instead of using the widget:

<div class="col-xs-8 text-right" style="font:15px lucida-console,sans-serif !important;" >
    <span style="color:grey !important;" t-field="company.partner_id" /><br/>
    <span style="color:grey !important;" t-field="company.partner_id.street" /><br/>
    <span style="color:grey !important;" t-field="company.partner_id.street2" /><br/>
    <span style="color:grey !important;" t-field="company.partner_id.city" /><br/>
    <span style="color:grey !important;" t-field="company.partner_id.country_id" /><br/>
</div>

This outputs the text with all the formatting, but not an elegant solution. I will update in case I do find an alternative.

2
Avatar
Descartar
Avatar
Abraham Anes
Mejor respuesta

Hello!

Try to put "!important" after them, like this:

<div class="col-xs-8 text-right"
                             style="color:green !important;font:italic 14px lucida-console, sans-serif !important;"
                             t-field="company.partner_id"
                             t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true }' />

0
Avatar
Descartar
Shawn Varghese
Autor

Thanks Abraham, but unfortunately, this does not seem to be working either. Do you have anything else in mind? Its becoming a major problem for me in creating reports.

Abraham Anes

I don't know what is wrong because I'm using this "

" and is working fine =/
Abraham Anes

"

"
Avatar
Paul Catinean
Mejor respuesta

!important after the css directive should work, also make sure you apply it on the actual tag you want changed not on the parent

Last but not least if you are dealing with invoices make sure the report does not have "Reload from attachment" ticked

Also go to: http://odoo-address:port/report/html/module.report_template_name/database_id and try editing the css directives there for easier debugging

 

 

0
Avatar
Descartar
Shawn Varghese
Autor

Thanks Paul, I've ensure that reload from attachment is unchecked but the problem persists. I'm using a workaround for now, as described in my answer. The URL that you gave sounds quite interesting. I was unable to make it work however. This is the link that I have constructed: http://0.0.0.0:8069/report/html/sv_sale_layout.report_saleorder_document_inherit/test Here 'sv_sale_layout' is the name of my module. 'report_saleorder_document_inherit' is the template name inside the xml and the database is 'test' . But nothing loads. In fact, it causes the server to crash, so its definitely doing something, but I guess I haven't constructed the URL correctly. Could you please tell me what the correction should be? Thanks again !

Paul Catinean

I have forgot to mention that you also should have the website module installed in order to use the html editor in this case.Check to see if it works then, and don't forget to use the database id at the end, here is a example of URL for standard reports: http://localhost:8069/report/html/stock.report_picking/10

Shawn Varghese
Autor

Yes, I got it to work now. Thanks!

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

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

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Odoo 12, Css not applied to qweb reports Resuelto
qweb report css
Avatar
Avatar
3
ene 20
7618
How To group by 2 fields in qweb report (product_gamme , product_id )?
qweb report odoo8
Avatar
Avatar
2
jul 19
7294
How to put a fixed header and footer in a report in odoo 17?
qweb report template odoo 17
Avatar
Avatar
Avatar
Avatar
3
sept 25
8362
CSS Flexbox not working when create pdf report
pdf qweb report css
Avatar
Avatar
1
feb 23
13189
How can i output a barcode without left and right margins on a odoo8 qweb report? Resuelto
qweb barcode report odoo8
Avatar
Avatar
Avatar
Avatar
Avatar
4
ene 23
13080
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.

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