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

wkhtml2pdf in Docker

Suscribirse

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

Se marcó esta pregunta
wkhtml2pdfdocker
1 Responder
3619 Vistas
Avatar
M

I'm running Odoo16 in the official Docker image.

I have a custom report inheriting from sale.report_saleorder. When I view a report in HTML, it's correct, with CSS applied. I can see report_assets_common and I can see my overrides that exist within style tags in my template.

However, when I view the report in PDF, the CSS is not applied, even the report_assets_common.

I have CSS that includes @font-face like so;

@font-face {

font-family: 'Raleway';

font-style: normal;

font-weight: 400;

src: url('/branding_nusa/static/fonts/Raleway-Light.ttf') format('truetype');

}

I also have an tag like so;

The image displays correctly, but the fonts only work on HTML.

I have report.url set to 'http://localhost:8069'

I know the resource is reachable from inside the container on the report.url because I can execute this from host;

docker exec -it odoo16 curl -I http://localhost:8069/branding_nusa/static/fonts/Raleway-Light.ttf

HTTP/1.0 200 OK

Content-Disposition: inline; filename=Raleway-Light.ttf

Content-Type: application/x-font-ttf

Content-Length: 182376

Last-Modified: Fri, 24 May 2024 03:25:15 GMT

Cache-Control: public, max-age=604800

Expires: Fri, 31 May 2024 08:52:47 GMT

ETag: "1716521115-182376-3913553847"

Date: Fri, 24 May 2024 08:52:47 GMT

Server: Werkzeug/1.0.1 Python/3.9.2

In the logs, I'm seeing this;

WARNING odoo16 odoo.addons.base.models.ir_actions_report: wkhtmltopdf: Exit with code 1 due to network error: ProtocolUnknownError

It's almost like the report.url isn't being prefixed to the resource URL.

My searching has only turned up the recommendations of setting report.url, or freezing the web.base.url.

Any ideas?


Apologies for the post being screwed up. It seems that the input is not escaped and every time I post, it gets screwed up in one way or another.

0
Avatar
Descartar
Avatar
M
Autor Mejor respuesta

Ok, accidentally stumbled upon the solution whilst trying to fix another problem.

Wrapping my report content in the following fixed it (note: I had to remove some of the markup as the forums don't escape content and it's trying to inject content in a code block as HTML);

        div class="article" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')"

It's not clear to me why this would have the impact that it does. There's nothing there that relates to resolution of the resource URLs. It feels more like a bug with this fix being an unintended side-effect.

ATTENTION ADMINS: The forums are seriously screwed up. Pasting HTML into code tags completely destroys the post. It's clearly not working as it was intended to.

0
Avatar
Descartar
¿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
docker-compose resulted in The connection was reset (from firefox) or Empty reply from server (from curl)? Resuelto
docker
Avatar
Avatar
2
sept 23
8039
Admin password does not load from odoo.conf
docker
Avatar
Avatar
1
sept 22
3704
How to add the webp service to my Odoo (with docker-compose)
docker
Avatar
0
feb 22
4142
Getting an Error while Printing Reports ODOO V9
wkhtml2pdf
Avatar
Avatar
1
jul 17
4057
Warn: Can't find .pfb for face 'Courier'
docker odoo18
Avatar
Avatar
Avatar
2
sept 25
5176
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