Qweb Report Printing -Odoo 8 -


in odoo 8 qweb report quotation use custom css styles in xml,

i receiving error below when select more 1 quotation , click print.

  • if print single quotation fine.
  • if remove custom css style xml working again.

here original file in module's "view" folder.

<?xml version="1.0" encoding="utf-8"?> <openerp> <data> <template id="sale_account_report1">     <!-- multicompany -->     <t t-if="o , 'company_id' in o">         <t t-set="company" t-value="o.company_id"></t>     </t>     <t t-if="not o or not 'company_id' in o">         <t t-set="company" t-value="res_company"></t>     </t>     <div class="header">         <div class="row">             <div class="col-xs-3">                 <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>             </div>         </div>         <div class="row zero_min_height">             <div class="col-xs-12">                 <div style="border-bottom: 1px solid black;"></div>             </div>         </div>         <div class="col-xs-5 pull-right">             <strong><span t-field="o.partner_id.name"/></strong>             <span t-field="o.partner_id.phone"/>         </div>     </div>     <div class="footer">         <div class="text-center" style="border-top: 1px solid black;">             <ul t-if="not company.custom_footer" class="list-inline">                 <li t-if="company.phone">phone: <span t-field="company.phone"/></li>                 <li t-if="company.fax , company.phone">&amp;bull;</li>                 <li t-if="company.fax">fax: <span t-field="company.fax"/></li>                 <li t-if="company.email">&amp;bull;</li>                 <li t-if="company.email">email: <span t-field="company.email"/></li>                 <li t-if="company.website">&amp;bull;</li>                 <li t-if="company.website">website: <span t-field="company.website"/></li>             </ul>             <t t-if="company.custom_footer">                 <span t-raw="company.rml_footer"/>             </t>             <ul class="list-inline">                 <li>page:</li>                 <li><span class="page"/></li>                 <li>/</li>                 <li><span class="topage"/></li>             </ul>         </div>     </div>     <div class="page">         <h3 align="center">sales order</h3>         <div class="row mt32 mb32" id="informations">             <div t-if="o.client_order_ref" class="col-xs-3">                 <strong>your reference:</strong>                 <p t-field="o.client_order_ref"/>             </div>             <div t-if="o.name" class="col-xs-4">                 <strong t-if="o.state not in ['draft','sent']">order n°: </strong>                 <strong t-if="o.state in ['draft','sent']">quotation n°: </strong>                 <p t-field="o.name"/>             </div>             <div t-if="o.date_order" class="col-xs-4">                 <strong t-if="o.state not in ['draft','sent']">date ordered:</strong>                 <strong t-if="o.state in ['draft','sent']">quotation date:</strong>                 <p t-field="o.date_order"/>             </div>             <div t-if="o.user_id.name" class="col-xs-4">                 <strong>total articles:</strong>                 <div t-esc="get_qty(o.order_line)"/>             </div>         </div>          <table class="table table-condensed">             <thead>                 <tr>                     <th>no.</th>                     <th>description</th>                     <th class="text-right">unit price</th>                     <th class="text-right">quantity</th>                     <th class="text-right">total</th>                 </tr>            </thead>            <tbody class="sale_tbody">                 <tr t-foreach="o.order_line" t-as="l">                     <td>                         <span t-esc="get_no(o.name)"/>                     </td>                     <td>                        <span t-field="l.name"/>                     </td>                     <td class="text-right">                         <span t-field="l.price_unit"/>                     </td>                     <td class="text-right">                         <span t-field="l.product_uom_qty"/>                         <span groups="product.group_uom" t-field="l.product_uom"/>                     </td>                     <td class="text-right">                         <span t-field="l.price_subtotal"                             t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>                     </td>                 </tr>             </tbody>         </table>          <div class="row">             <div class="col-xs-4 pull-right">                 <table class="table table-condensed">                     <tr class="border-black">                         <td><strong>total</strong></td>                         <td class="text-right">                             <span t-field="o.amount_untaxed"                                 t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>                         </td>                     </tr>                     <tr>                         <td>taxes</td>                         <td class="text-right">                             <span t-field="o.amount_tax"                                 t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>                         </td>                     </tr>                     <tr class="border-black">                         <td><strong>this invoice total</strong></td>                         <td class="text-right">                             <span t-field="o.amount_total"                                 t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>                         </td>                     </tr>                     <tr t-if="o.state in ['draft','sent']" class="border-black">                         <td><strong>overdue payment</strong></td>                         <td class="text-right">                             <span t-field="o.partner_id.credit"                                 t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>                         </td>                     </tr>                     <tr t-if="o.state in ['draft','sent']" class="border-black">                         <td><strong>total amount due</strong></td>                         <td class="text-right">                             <span t-raw='o.amount_total + o.partner_id.credit'                                 t-raw-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>                         </td>                     </tr>                 </table>             </div>         </div>          <p t-field="o.note" />         <p t-if="o.payment_term">             <strong>payment term:</strong>             <span t-field="o.payment_term"/>         </p>         <div class="oe_structure"/>     </div> </template>  <template id="sale_account_report.report_saleorder_custom">     <t t-call="report.html_container">         <t t-foreach="doc_ids" t-as="doc_id">             <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale_account_report.sale_account_report1')"/>         </t>     </t> </template> </data> </openerp> 

if use original file, works fine, if put below style in somewhere in file

<div  style="font:18px 'jameel noori nastaleeq', 'nafees web naskh' !important;"> 

report works 1 quotation, if select multiple quotations, below errors comes up. if remove style , update module, works fine again. please me.

traceback (most recent call last):   file "/opt/odoo/odoo/addons/report/controllers/main.py", line 121, in report_download     response = self.report_routes(reportname, docids=docids, converter='pdf')   file "/opt/odoo/odoo/openerp/http.py", line 388, in response_wrap     response = f(*args, **kw)   file "/opt/odoo/odoo/addons/report/controllers/main.py", line 65, in report_routes     pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=options_data, context=context)   file "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper     return old_api(self, *args, **kwargs)   file "/opt/odoo/odoo/addons/report/models/report.py", line 269, in get_pdf     paperformat, specific_paperformat_args, save_in_attachment   file "/opt/odoo/odoo/openerp/api.py", line 237, in wrapper     return old_api(self, *args, **kwargs)   file "/opt/odoo/odoo/addons/report/models/report.py", line 480, in _run_wkhtmltopdf     entire_report_path = self._merge_pdf(pdfdocuments)   file "/opt/odoo/odoo/addons/report/models/report.py", line 569, in _merge_pdf     writer.write(merged_file)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 264, in write     self._sweepindirectreferences(externalreferencemap, self._root)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 339, in _sweepindirectreferences     self._sweepindirectreferences(externmap, realdata)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 315, in _sweepindirectreferences     value = self._sweepindirectreferences(externmap, value)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 339, in _sweepindirectreferences     self._sweepindirectreferences(externmap, realdata)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 315, in _sweepindirectreferences     value = self._sweepindirectreferences(externmap, value)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 324, in _sweepindirectreferences     value = self._sweepindirectreferences(externmap, data[i])   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 339, in _sweepindirectreferences     self._sweepindirectreferences(externmap, realdata)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 315, in _sweepindirectreferences     value = self._sweepindirectreferences(externmap, value)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 354, in _sweepindirectreferences     newobj = self._sweepindirectreferences(externmap, newobj)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 315, in _sweepindirectreferences     value = self._sweepindirectreferences(externmap, value)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 315, in _sweepindirectreferences     value = self._sweepindirectreferences(externmap, value)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 345, in _sweepindirectreferences     newobj = data.pdf.getobject(data)   file "/usr/lib/pymodules/python2.7/pypdf/pdf.py", line 649, in getobject     retval = readobject(self.stream, self)   file "/usr/lib/pymodules/python2.7/pypdf/generic.py", line 67, in readobject     return dictionaryobject.readfromstream(stream, pdf)   file "/usr/lib/pymodules/python2.7/pypdf/generic.py", line 519, in readfromstream     key = readobject(stream, pdf)   file "/usr/lib/pymodules/python2.7/pypdf/generic.py", line 87, in readobject     return numberobject.readfromstream(stream)   file "/usr/lib/pymodules/python2.7/pypdf/generic.py", line 227, in readfromstream     return numberobject(name) valueerror: invalid literal int() base 10: '' 


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -