Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

QWeb reports: how to properly show html fields edited through website builder?

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
website_builderqweb-reportodoo12.0
3 Risposte
19691 Visualizzazioni
Avatar
faOtools

Hello,

the goal is to generate a pdf with complex raw html data:

  • Model has a simple not-sanitized html field

  • That field might be edited by user through the Odoo website editor. In such a way its content might be complex and might have bootstrap classes such as 'col-lg-6', etc.

  • The pdf is generated using QWeb templates.

As a result, when printed not full content of containers is reflected in pdf. In particular, some columns are outside the page (not visible). For example, if to add the snippet '3 columns' or 'image + text column', only the first column is printed.

The question is what is a safe method to reflect the most content of html field in QWeb template.

Already tried:

  • t-esc, t-raw, t-field

  • wrapping in containers and in different html tags

  • provide css styles, including assigning different 'display' param

  • t-set full_width, even landscape page format

Please find a sample of source code below.

Field declaration

    description =fields.Html(string="Description", sanitize=False)

Reports

    <template id="report_item_document">
        <t t-call="web.external_layout">
            <div class="page">
                <div class="oe_structure"/>
                <h2><span t-field="doc.name"/></h2>
                <div>
                    <t t-raw="doc.description"/>
                </div>
                <div class="oe_structure"/>
            </div>
        </t>
    </template>

    <template id="report_item">
        <t t-call="web.html_container">
            <t t-foreach="docs" t-as="doc">
                <t t-call="my_module.report_item_document"/>
            </t>
        </t>
    </template>

2
Avatar
Abbandona
Sehrish

Odoo Customization Tips: https://learnopenerp.tumblr.com/

faOtools
Autore

Hi, Sehrish. I do not need to learn Odoo, I do need to print pdf with website edited html. Search by 'qweb' returns only very standard questions which are of no use for me

Avatar
faOtools
Autore Risposta migliore

For those who faced a similar issue: what we have revealed:

The only viable way seems to redefine all styles used in website in qweb to fit the page or/and replace classes before printing. This taks is a sort of drastic job since assumes a lot of experimenting and coding. Moreover, some styles are just difficult to show in a printing version (e.g. video links, slider effects, etc.). Thus, this approach is not promising.

The better is to initially restrict users in using building blocks (snippets) to fit a printing version. Similar job is done in the mass_mailing module where all blocks are table-wrapped. Although it also implies quite much of coding to prepare a builder and snippets, it is much safer.

The last found way is to use browser printing version of a page. In that case a lot of excess elements are added, and there is a need to work with external to Odoo features.

0
Avatar
Abbandona
Nikunj Dhameliya

Hi, I am facing similar type of issue, can you check it out, please? https://www.odoo.com/forum/help-1/question/how-to-apply-flex-style-to-report-163753

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
Change the distance between table cells on qweb. How to do it? Risolto
qweb-report odoo12.0
Avatar
Avatar
2
dic 19
18180
Can we embed self hosted video in the app of website builder?
video website_builder odoo12.0 odoo11.0
Avatar
Avatar
Avatar
4
mar 20
5497
What mean theme.ir.ui.view ?
website_builder themes odoo12.0 v12
Avatar
Avatar
Avatar
Avatar
Avatar
5
gen 20
8824
AssertionError while install Appoinment in website
website_builder
Avatar
Avatar
Avatar
2
nov 25
339
Expected singleton: hr.emp.travel.location(62, 63)
odoo12.0
Avatar
Avatar
Avatar
2
ott 25
2002
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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