0

I'm create report with bootstrap element...https://postimg.org/image/nyoith02t/

Look is not good, how add bootstrap path on report, or inherit from other module?

My module location is odoo9 / custom_module / my_module (not in addons).

user_odoo
  • 2,284
  • 34
  • 55

1 Answers1

0

Create A Report With an Empty STYLE TAG.

<openerp>
    <data>
    <report
        id="report_for_my_model"
        model="myaddon.mymodel"
        string="Report"
        name="myaddon.report_view"
        file="myaddon.report_for_my_model"
        report_type="qweb-pdf"/>

    <template id="report_view">
        <style type="text/css">
        </style>
        <t t-call="report.html_container">
            <t t-foreach="docs" t-as="doc">
                <t>
                    <div class="page">
                        <!-- YOUR REPORT HERE -->
                    </div>    
                </t>
            </t>
        </t>
    </template>
  </data>
</openerp>

Then create another file and paste bootstrap's css inside it. I am not sure if you can use minified. You also may have to replace < with &lt; but I am not entirely sure. This technique works for simple css, I know that as I use it.

<openerp>
  <data>
    <template id="myaddon_bootstrap_style" inherit_id="myaddon.report_view">
      <xpath expr="//style" position="after">
        <style type="text/css">
            /*
               YOUR CSS HERE 
            */
        </style>
      </xpath>
    </template>
  </data>
</openerp>
Phillip Stack
  • 3,308
  • 1
  • 15
  • 24