I have used this code but not working returning empty PDF file in odoo 10
self.env['report'].sudo().get_pdf(self, 'equipment_management.report_gatepass')
.xml code:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report id="equipment_action"
model="calibration.details"
string="Gatepass "
report_type="qweb-pdf"
name="equipment_management.report_gatepass"
file="equipment_management.report_gatepass"
/>
<record id="paperformats" model="report.paperformat">
<field name="name">European A4 low margins</field>
<field name="default" eval="True" />
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">20</field>
<field name="margin_bottom">20</field>
<field name="margin_left">20</field>
<field name="margin_right">20</field>
<field name="header_line" eval="False" />
<field name="header_spacing">10</field>
<field name="dpi">90</field>
</record>
<record id="equipment_management.equipment_action" model="ir.actions.report.xml">
<field name="paperformat_id" ref="equipment_management.paperformats" />
</record>
<template id="report_gatepass">
<t t-call="report.html_container">
<t t-set="counter" t-value="001"/>
<t t-foreach="docs" t-as="o">
<div class="page">
<style>
.box{
background: black;
max-width: 250px;
text-align:center;
color:white;}
</style>
<div class="row">
<table width="100%" cellpadding="0px" cellspacing="0px" style="border:1px solid black">
<tr style="border-bottom:1px solid black">
<td width="20%" valign="top" align="center" padding="15px">
<img t-att-src="'data:image/png;base64,%s' % res_company.logo" height="100px" width="90px" />
</td>
<td width= "80%">
<div style="font-size:18px;"><center><b><t t-if="res_company.name" t-esc="res_company.name"/></b></center></div>
<div style="font-size:12px;"><center><t t-if="res_company.rml_header1" t-esc="res_company.rml_header1"/></center></div>
<div style="font-size:12px"><center><t t-if="res_company.street" t-esc ="res_company.street"/> <t t-if="res_company.street2" t-esc ="res_company.street2"/> <t t-if="res_company.state_id" t-esc ="res_company.state_id.name"/> <t t-if="res_company.country_id" t-esc ="res_company.country_id.name"/></center></div>
<div style="font-size:12px"><center>Tel No.<t t-if="res_company.phone" t-esc ="res_company.phone"/>, Fax<t t-if="res_company.fax" t-esc ="res_company.fax"/>, Email <t t-if="res_company.email" t-esc ="res_company.email"/>, Website <t t-if="res_company.website" t-esc ="res_company.website"/></center></div>
</td>
</tr>
<tr>
<td colspan="2" width="100%" style="font-size:24px"><center><div class="box"><strong>GATEPASS</strong></div></center></td>
</tr>
<tr style="border-bottom:1px solid black">
<td colspan="2" width="100%" style="font-size:14px"><center><strong>(NIWE-Returnable Material)</strong></center></td>
</tr>
<tr style="border-bottom:1px solid black">
<td colspan="2">
<table width="100%" cellpadding="0px" cellspacing="0px">
<tr>
<td width="25%" style="font-size:14px;line-height:300%;"><center><strong>Reference No.:</strong></center></td>
<td width="25%" style="font-size:14px;line-height:300%;text-align:left;"><strong><t t-esc="o.name"/></strong></td>
<td width="25%" style="font-size:14px;line-height:300%;"><center><strong>Date:</strong></center></td>
<td width="25%" style="font-size:14px;line-height:300%;text-align:left"><strong><span t-field="o.date" t-field-options='{"format": "dd-MM-y"}'/></strong></td>
</tr>
</table>
</td>
</tr>
<tr style="border-bottom:1px solid black">
<td colspan="2">
<table width="100%" cellpadding="0px" cellspacing="0px" style="font-size:12px">
<tr style="border-bottom:1px solid black;height:50px;">
<td width="5%" style="text-align:center;border-right:1px solid black">1</td>
<td width="53%" style="padding-left:5px;border-right:1px solid black">Name and Designation of the Person taking the Material</td>
<td width="42%" style="padding-left:5px"><t t-if="o.responsible_person.name" t-esc="o.responsible_person.name"/></td>
</tr>
<tr style="border-bottom:1px solid black;height:60px;">
<td width="5%" style="text-align:center;border-right:1px solid black">2</td>
<td width="53%" style="padding-left:5px;border-right:1px solid black">Address of supplier taking material out of NIWE Campus(with phone No.)</td>
<td width="42%" style="padding-left:5px">
<div style="font-size:12px"><t t-if="o.responsible_person.street" t-esc ="o.responsible_person.street"/></div>
<div><t t-if="o.responsible_person.street2" t-esc ="o.responsible_person.street2"/></div>
<div><t t-if="o.responsible_person.state_id" t-esc ="o.responsible_person.state_id.name"/> </div>
<div><t t-if="o.responsible_person.country_id" t-esc ="o.responsible_person.country_id.name"/></div>
<div style="font-size:12px"><t t-if="o.responsible_person.phone" t-esc ="o.responsible_person.phone"/></div>
<div><t t-if="o.responsible_person.mobile" t-esc ="o.responsible_person.mobile"/></div>
</td>
</tr>
<tr style="border-bottom:1px solid black;height:60px;">
<td width="5%" style="text-align:center;border-right:1px solid black">3</td>
<td width="53%" style="padding-left:5px;border-right:1px solid black">Description of items with its serial Number and Quantity etc.,</td>
<td width="42%" style="padding-left:5px">
<div><b>Name:</b><t t-if="o.instrument.name" t-esc="o.instrument.name"/></div>
<div><b>Serial No:</b><t t-if="o.serial" t-esc="o.serial"/></div>
<div><b>Description:</b><t t-if="o.instrument.description" t-esc="o.instrument.description"/></div>
</td>
</tr>
<tr style="border-bottom:1px solid black;height:60px;">
<td width="5%" style="text-align:center;border-right:1px solid black">4</td>
<td width="53%" style="padding-left:5px;border-right:1px solid black">Purpose for which the Material(s) in/are being taken out</td>
<td width="42%" style="padding-left:5px"><t t-if="o.purpose" t-esc="o.purpose"/></td>
</tr>
<tr style="border-bottom:1px solid black;height:60px;">
<td width="5%" style="text-align:center;border-right:1px solid black">5</td>
<td width="53%" style="padding-left:5px;border-right:1px solid black">Probable date of return of Material if any</td>
<td width="42%" style="padding-left:5px"><t t-if="o.date_of_return"><span t-field="o.date_of_return" t-field-options='{"format": "dd-MM-y"}'/></t></td>
</tr>
<tr style="border-bottom:1px solid black;height:60px;">
<td width="5%" style="text-align:center;border-right:1px solid black">6</td>
<td width="53%" style="padding-left:5px;border-right:1px solid black">NIWE-officer responsible for inspection Returning the Material</td>
<td width="42%" style="padding-left:5px"><t t-if="o.officer.name" t-esc="o.officer.name"/></td>
</tr>
<tr style="height:60px;">
<td width="5%" style="text-align:center;border-right:1px solid black">7</td>
<td width="53%" style="padding-left:5px;border-right:1px solid black">Any other Informations</td>
<td width="42%" style="padding-left:5px"><t t-if="o.other_info" t-esc="o.other_info"/></td>
</tr>
</table>
</td>
</tr>
</table>
<table style="font-size:12px" width="100%">
<tr>
<br/><br/><br/><br/>
</tr>
<tr>
<td width="35%" style="text-align:left"><span><div>Signature of the person taking the</div>
<div>Material out NIWE Campus</div></span></td>
<td width="35%"><span><div>Signature of the Officer/Material</div><div style="text-align:center">Indenter</div></span></td>
<td width="30%" style="text-align:right">Signature of Head/Project Leader</td>
</tr>
</table>
<table style="font-size:12px" width="100%">
<tr>
<br/><br/><br/><br/>
</tr>
<tr>
<td width="50%" style="text-align:left">Authorized Signatory</td>
<td width="50%" style="text-align:right"><span>Signature of Security Officer/Security
<div>Guard on duty in NIWE</div></span></td>
</tr>
</table>
</div>
</div>
</t>
</t>
</template>
</data>
</openerp>
Correct syntax:
pdf = request.env['report'].sudo().get_pdf([sale_order_id], 'sale.report_saleorder', data=None)
By default the report format of Odoo reports are in PDF, I don't know why your specifically asking for pdf file while printing. The below given is a sample code for attaching PDF file of sale_order report as attachment to the order/quotation using .get_pdf.
Example:
#api.multi
def print_quotation(self):
for order in self:
result = self.env['report'].sudo().get_pdf([order.id], 'sale.report_saleorder')
return self.env['ir.attachment'].create({
'name': 'Sample',
'type': 'binary',
'datas': base64.encodestring(result),
'res_model': 'sale.order',
'res_id': order.id,
'mimetype': 'application/x-pdf'
})
Openerp has changed to Odoo. So please change the below section in your code if you are using Odoo 10.0:
<openerp>
<data>
</data>
</openerp>
to
<odoo>
<data>
</data>
</odoo>
Hope this may help you !
Related
Having a hard time fixing my issue when rendering QWeb reports to PDF. Using the /report/html style is fine.
I need to push the TAX INVOICE # div to the very right side. Below is rendered from PDF
Rendered in PDF
In /report/html it is working fine.
Rendered in html
Using this style: style="width: auto; margin-right: 0px; margin-left: auto;" inside the div
<div class="row">
<div>
<table class="table table-sm o_main_table table-bordered" border="1">
<thead>
<tr>
<th class="text-center" colspan="2"><span>CUSTOMER</span></th>
</tr>
<tr>
<th class="text-left"><span>SHIP TO:</span></th>
<th class="text-left"><span>BILL TO:</span></th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-att-class="'font-weight-bold o_line_section'">
<td class="text-left"><span t-field="doc.partner_shipping_id.name" t-options="{'widget': 'text'}" /> <span t-field="doc.partner_shipping_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' /></td>
<td class="text-left"><span t-field="doc.partner_id.name" t-options="{'widget': 'text'}" /> <span t-field="doc.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' /></td>
</tr>
</tbody>
</table>
</div>
<div style="width: auto; margin-right: 0px; margin-left: auto;">
<table class="table table-sm o_main_table table-bordered" border="1" style="width: 100%">
<thead>
<tr>
<th class="text-center" colspan="2">
<span>TAX INVOICE #</span>
</th>
</tr>
</thead>
<tbody>
<tr t-att-class="'font-weight-bold o_line_section text-center'">
<td colspan="2"><h3 style="color: red;"><strong><span t-field="doc.name" t-options="{'widget': 'text'}"/></strong></h3></td>
</tr>
</tbody>
</table>
</div>
</div>
Try float instead. Set float to right for the second table (div) which contains tax invoice. It will work.
i have 2 problemes with long tables in Qweb.
1/ if there is no place for all table on first page , Qweb print all the table on seconde page . but i want the first part of table on the first page and the seconde part on the seconde page (look to img1 and img2).
2/if the table is too long i have probleme with thead and tbody for all pages(
thead and tbody start from the same line so for all pages the first ligne is illisible ) except the first one (look to img3 and img4).
i added a comment to understand which table i'm talking about it (comment "This table" before table and "End table" after table).
Thanks
<odoo>
<data>
<record id="facture_cadre_format" model="report.paperformat">
<field name="name">European A4</field>
<field name="default" eval="True" />
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">80</field>
<field name="margin_bottom">23</field>
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False" />
<field name="header_spacing">70</field>
<field name="dpi">90</field>
</record>
<report id="new_factures"
string="Facture (new)"
model="account.invoice"
report_type="qweb-pdf"
name="livraison_report.new_facture"
paperformat="facture_cadre_format"
/>
<template id="new_facture">
<t t-call="report.html_container">
<t t-call="facture_layout.facture_layout">
<div class="page">
<!-- Report page content -->
<style>
tbody {
font-size: 10px;
}
.police {
font-size: 10px;
}
.tableau {
page-break-inside: avoid;
}
</style>
<t t-foreach="docs" t-as="o">
<h2>
<span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Facture</span>
<span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span>
<span t-if="o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
<span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
<span t-if="o.type == 'out_refund'">Refund</span>
<span t-if="o.type == 'in_refund'">Vendor Refund</span>
<span t-if="o.type == 'in_invoice'">Vendor Bill</span>
<span t-field="o.number"/>
</h2>
<div class="row mt32 mb32">
<div class="col-xs-2" t-if="o.name">
<strong>Description:</strong>
<p t-field="o.name"/>
</div>
<div class="col-xs-2" t-if="o.date_invoice">
<strong>Date de la facture:</strong>
<p t-field="o.date_invoice"/>
</div>
<div class="col-xs-2" t-if="o.date_due and o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">
<strong>Date d'échéance:</strong>
<p t-field="o.date_due"/>
</div>
<div class="col-xs-2" t-if="o.origin">
<strong>Origine:</strong>
<p t-field="o.origin"/>
</div>
<div class="col-xs-2" t-if="o.partner_id.ref">
<strong>BL:</strong>
<span t-esc="', '.join(map(lambda x: (x.name), o.picking_id))"/>
</div>
<div name="reference" class="col-xs-2" t-if="o.reference">
<strong>Reference:</strong>
<p t-field="o.reference"/>
</div>
</div>
<!-- _______________________________________________________This Table__________________________________________________________________ -->
<table class="table table-condensed table-bordered ">
<thead>
<tr style="background-color:#A9E2F3;">
<th>Description</th>
<th class="hidden">Source Document</th>
<th class="text-right">P.U</th>
<th class="text-right">PPA</th>
<th class="text-right">PPH</th>
<th class="text-right">Qté</th>
<th class="text-center">UM</th>
<th class="text-center">Mnt Brut</th>
<th class="text-right">RM(%)</th>
<th class="text-right">Tax Excluded Price</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td>
<span t-field="l.name"/>
<t t-if="(l.lot_formatted_note is not False)">
<div style="margin-left:25px;" t-field="l.lot_formatted_note" />
<br/>
</t>
</td>
<td class="hidden"><span t-field="l.origin"/></td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td class="text-right">
<span t-field="l.ppa"/>
</td>
<td class="text-right">
<span t-field="l.prix_pharmacien"/>
</td>
<td class="text-right">
<span t-esc="'%.0f'%(l.quantity)"/>
</td>
<td class="text-center">
<span t-field="l.uom_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal_brut"/>
</td>
<td class="text-right">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</tr>
</tbody>
</table>
<!-- _______________________________________________________End Table__________________________________________________________________ -->
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed table-bordered tableau">
<tr class="border-black" >
<td><strong>Montant BRUT</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed_brut" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</tr>
<tr class="border-black" >
<td><strong>Montant Remise</strong></td>
<td class="text-right">
<span t-field="o.amount_discount" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</tr>
<tr class="border-black">
<td><strong>Montant HT</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</tr>
<t t-foreach="o._get_tax_amount_by_group()" t-as="amount_by_group">
<tr>
<td><span t-esc="amount_by_group[0] if len(o.tax_line_ids) > 1 else (o.tax_line_ids.tax_id.description or o.tax_line_ids.tax_id.name)"/></td>
<td class="text-right">
<span t-esc="amount_by_group[1]" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</tr>
</t>
<tr class="border-black">
<td><strong>Montant TTC</strong></td>
<td class="text-right">
<span t-field="o.amount_total" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
</td>
</tr>
</table>
</div>
</div>
<p class="police">
<strong>ARRETEE LA PRESENTE FACTURE A LA SOMME DE:</strong>
<span t-field="o.amount_to_text"/>
</p>
<p t-if="o.comment">
<strong>Comment:</strong>
<span t-field="o.comment"/>
</p>
<p t-if="o.payment_term_id">
<span t-field="o.payment_term_id.note"/>
</p>
<p t-if="o.fiscal_position_id.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="o.fiscal_position_id.note"/>
</p>
<table class="table table-condensed table-bordered tableau">
<thead>
<tr >
<th class="text-center"><strong>Commercial</strong></th>
<th class="text-center"><strong>Client</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<br/>
<br/>
</td>
<td>
<br/>
<br/>
</td>
</tr>
</tbody>
</table>
</t>
</div>
</t>
</t>
</template>
</data>
</odoo>
Use <thead> tag for your requirement.
Hi try changing the values of some fields in this record,
<record id="facture_cadre_format" model="report.paperformat">
<field name="name">European A4</field>
<field name="default" eval="True" />
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">80</field>
<field name="margin_bottom">23</field>
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False" />
<field name="header_spacing">70</field>
<field name="dpi">90</field>
</record>
I have faced the same issue and rectified by changing some values here.I don't correctly remember which one.Try changing values of page height and if it doesn't work try other fields.
<div class="row" style="border:1px solid black;">
<table class="table table-condensed" >
<thead style="border: 1px solid black;">
<tr>
<th class="text-left" width="5%" style="border-left:1px solid black;">Sl no</th>
<th class="text-center" style="border-left:1px solid black;">Account</th>
<th class="text-center" style="border-left:1px solid black;">Partner</th>
<th class="text-center" style="border-left:1px solid black;">Internal Reference</th>
<th class="text-center" style="border-left:1px solid black;">Description</th>
<th class="text-center" style="border-left:1px solid black;">Debit Amount(AED)</th>
<th class="text-center" style="border-left:1px solid black;">Credit Amount(AED)</th>
</tr>
</thead>
<tbody style="border-bottom: 1px solid black;">
<t t-set="count" t-value="1"/>
<tr t-foreach="o.line_ids" t-as="l" style="border-top: 1px solid black;">
<td class="text-left" width="5%"><span t-esc="count"/> <t t-set="count" t-value="count + 1"/></td>
<td class="text-left" style="border-left:1px solid black;"><span t-field="l.account_id.name"/></td>
<td class="text-left" style="border-left:1px solid black;"><span t-field="l.partner_id"/></td>
<td class="text-left" style="border-left:1px solid black;"><span t-field="l.account_id.code"/></td>
<td class="text-left" style="border-left:1px solid black;"><span t-field="l.name"/></td>
<td class="text-right" style="border-left:1px solid black;"><span t-field="l.debit"/></td>
<td class="text-right" style="border-left:1px solid black;"><span t-field="l.credit"/></td>
</tr>
<tr>
<td style="display:inline;border-left:1px solid black;border-top:1px solid black;">
<span t-if="o.ref">
<span>Reference:</span><span><span t-field="o.ref"/></span>
</span>
</td>
<td style="border-top:1px solid black;">
</td>
<td style="border-top:1px solid black;">
</td>
<td style="border-top:1px solid black;">
</td>
<td style="border-top:1px solid black;">
</td>
<td style="border-top:1px solid black;">
</td>
<td style="border-top:1px solid black;">
</td>
</tr>
</tbody>
</table>
</div>
Hi above is my xml code . Problem I face is that I cannot set a width for the column Sl No I tried by putting width="5%" in th and td and I also tried putting it in style like style="width:5%" but that also does n't work. Please Help .
Thanks in advance...
The width of th will be set correctly. The issue should be in the value of width, 5% is maybe not enough to show Sl No on the same line.
Try
<tr>
<td colspan="7" style="display:inline;border-left:1px solid black;border-top:1px solid black;">
<span t-if="o.ref">
<span>Reference:</span><span><span t-field="o.ref"/></span>
</span>
</td>
</tr>
<openerp>
<data>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//span[#t-field='t.amount']" position="after">
<span t-field="t.note"/>
</xpath>
</template>
</data>
</openerp>
i added field to invoice report inside tax table. but how can i make tax table visible only if there is note field, and hide if note is empty.
i trying something with t-if but my goal is to show tax table not to hide it when note field is not empy. is there any kind of t-ifnot?
<xpath expr="//span[#t-field='t.amount']/../../../../thead/tr" position="replace">
<th t-if="o.notes"
</xpath>
Yes. We can achieve it with following example:
<t t-if="o.notes">
<!-- Fields visible if Notes has value-->
</t>
<t t-if="not o.notes">
<!-- Fields visible if Notes has no value-->
</t>
EDIT
Design your table in one of condition.
<t t-if="o.notes">
<table style="border:1px solid; width:100%">
<thead>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</t>
Hello An..,
Best Learning Tutorial
If you want use any types of condition so QWeb is provides many types of inbuilt functionality. More information for read below link,
1) https://www.odoo.com/documentation/8.0/reference/qweb.html
Solution
Account invoice base/odoo table is below,
<div class="row" t-if="len(o.tax_line_ids) > 0">
<div class="col-xs-6">
<table class="table table-condensed">
<thead>
<tr>
<th>Tax</th>
<th class="text-right">Base</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.tax_line_ids" t-as="t">
<td><span t-field="t.tax_id.description"/></td>
<td class="text-right">
<span t-field="t.base" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td class="text-right">
<span t-field="t.amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
Now you want to show the table when t.note field is not empty so odoo XML provides if condition to check the anything.
Now try this below code for your problem,
<openerp>
<data>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//span[#t-field='t.amount']" position="after">
<t t-if="t.note">
<span t-field="t.note"/>
<!-- For example i add one new table -->
<table class="table table-condensed">
<thead>
<tr>
<th>Tax</th>
<th class="text-right">Base</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.tax_line_ids" t-as="t">
<td><span t-field="t.name"/></td>
<td class="text-right">
<span t-field="t.base"
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
<td class="text-right">
<span t-field="t.amount"
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
</tr>
</tbody>
</table>
</t>
<t t-if="not t.note">
<!-- If empty t.note so not show tax table -->
</t>
</xpath>
</template>
</data>
</openerp>
I hope my answer is helpful.
If any query so comment please.
I'm coding an email for my employer. The font-size should be 16px. I declared it in table td, but it's being overwritten somewhere. I absolutely cannot figure out how or why. Has anyone else run into this issue?
Edit: I should specify that the undesired font-size is occurring on mobile only:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
<title>Title</title>
<style type="text/css">
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,700);
body {
width: 100% !important;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
margin: 0;
padding: 0;
}
#background_table {
margin: 0;
padding: 0;
width: 100%!important;
line-height: 100%!important;
}
img {
outline: none;
text-decoration: none;
border: none;
-ms-interpolation-mode: bicubic;
max-width: 100%;
height: auto;
display: block;
}
table td {
border-collapse: collapse;
vertical-align: middle;
font-family: 'Open Sans', Trebuchet, sans-serif;
font-size: 16px!important;
line-height:120%;
color: #000;
}
table td[class="column"] {
height: 100px;
width: 640px;
}
table {
border-collapse: collapse;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
table[class="body_table"] {
width: 640px;
margin-top: 21px;
}
table span[class="h1"] {
font-weight:300;
font-size:23px;
color:#ff9001;
}
table td[class="top-buffer"] {
padding-top: 25px;
}
</style>
</head>
<body>
<!-- background table start -->
<table width="100%" bgcolor="#ffffff" cellpadding="0" cellspacing="0" border="0" id="background_table">
<tbody>
<tr>
<td>
<!-- end of background table start -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td style="display:inline-block;" width="100%"><img src="#" alt="Logo" style="display:block;">
</td>
</tr>
<tr>
<td width="100%" height="20"> </td>
</tr>
<tr>
<td width="100%" height="100">
<img src="#" alt="Hero" style="display:block;">
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- hello/quick links -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="640" class="column" style="height:100%;font-size:20px;">Hello,
<br> Content
</td>
</tr>
<tr>
<td height="10"> </td>
</tr>
<tr>
<td width="640" class="column" style="padding-top:20px;padding-bottom:20px;">
<span class="h1">Quick Links</span>
<br>
<span style="display:inline-block; padding-bottom:5px;"><strong>LE Brochure 14min</strong></span>
<br> Got a booth at a trade show or event? This video can be set to play continuously to draw more attention and foot traffic.
<br>
<br>
<span style="display:inline-block; padding-bottom:5px;"><strong>FedEx Flyer Link</strong></span>
<br> Customizable seasonal flyers available
<br>FedEx Product Service Gateway
<br>
<br>
<span style="display:inline-block; padding-bottom:5px;"><strong>Marketing Bulletin Archive</strong></span>
<br>Intranet
</td>
</tr>
</tbody>
</table>
<!-- hello/quick links -->
<br>
<!-- marketing communications -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td>
<span class="h1">Marketing Communications</a>
</td>
</tr>
</tbody>
</table>
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="148" class="column-img" style="height:100%;display:inline-block;margin-right:17px">
<img src="#" style="display:block;">
</td>
</tr>
<tr>
<td width="503" class="column-text-1"><span style="font-size:18px;display:inline-block; padding-top:10px;padding-bottom:5px;">
<strong>Top Video Testimonials</strong></span>
<br> Four 90-second videos now in our Resource Center with tips from families to families. Click here to view.
</td>
</tr>
</tbody>
</table>
<!-- marketing communications -->
<br>
<!-- new print collateral -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">New Print Collateral</span>
</td>
</tr>
</tbody>
</table>
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="148" class="column-img" style="height:100%;display:inline-block;margin-right:17px">
<img src="#" style="display:block;">
</td>
</tr>
<tr>
<td width="503" class="column-text-1"><span style="font-size:18px;display:inline-block; padding-top:10px;padding-bottom:5px;"><strong>New for events and booths: Women & Alzheimer’s 24x36 foam board poster</strong></span>
<br> Now avaiblable on our FedEx Product Service Gateway. SKU1450. You can find this 24x36 poster under Programs/Women and Alzheimer’s. Here’s an informative story
from The Washington Post for more
background on why women get Alzheimer’s more than men and who is more at risk.
</td>
</tr>
</tbody>
</table>
<!-- new print collateral -->
<br>
<!-- advertising -->
<!-- brand ads -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1" style="display:inline-block;">Advertising</span>
<br>
<span style="font-size:18px;">
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td>
<span style="font-size:18px;"><strong>Brand Ads Spring/Summer 2015</strong></span>
</td>
</tr>
<tr>
<td width="350" class="column" style="height:100%;margin-right:131px">
<img src="#">
</td>
</tr>
<tr>
<td width="350" height="10">
</td>
</tr>
<tr>
<td style="height:100%;" width="350" class="column">
<img src="#">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!-- brand ads -->
<!-- community ads -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td style="padding-top:30px;padding-bottom:10px;">
<span style="font-size:18px;"><strong>Community Event Ads Getting Results</strong></span>
</td>
</tr>
<tr>
<td width="350" class="column" style="height:100%;margin-right:131px">
<img src="#" style="min-width:350px; display:block">
<table>
<tbody>
<tr>
<td width="350" style="padding-top:10px;padding-bottom:40px;">
Over 100 attended this Pleasant Hill film critic event. General Manger Aubrey Goo says, “The ads definitely helped.”
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="height:100%;" width="350" class="column"><img src="#" style="min-width:350px;display:block">
<table>
<tbody>
<tr>
<td width="350" style="padding-top:10px">
<br> This Moraga Dementia speaker event is dubbed a success. Marketing Director Nancy Moraga says, “This event was successful because we stuck to the basics in helping people understand what Dementia is.” She ran the ad and mailed flyers.
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!-- community ads -->
<!-- advertising -->
<br>
<!-- talent acquisition -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">Talent Acquisition and Retention Tools</span>
</td>
</tr>
</tbody>
</table>
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="100%" height="100">
<a href="#s" target="_blank">
<img src="#" style="width:100%;display:block;"></a>
</td>
</tr>
<tr>
<td width="100%" height="100">
<span style="font-size:18px;display:inline-block; padding-top:10px;"><strong>Nurse Acquisition Video</strong></span>
<br> Nurses are in high demand. As a company, we need to break through the stereotype of senior living to attract the best talent. This graphic links to a 2-minute video testimonial about why our nurses choose to grow careers at focusing
on what we offer that hospitals and clinics don’t. Copy and paste this graphic, with the hyperlink, into your emails when you are recruiting nurse candidates.
</td>
</tr>
</tbody>
</table>
<!-- text -->
<!-- talent acquisition -->
<br>
<!-- new expert advice -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">New Expert Advice in the Resource Center</span>
</td>
</tr>
</tbody>
</table>
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td style="padding-bottom:40px;">
<span style="display:inline-block;">NEW articles sent from our Resource Center on our website can help you help your local caregivers, prospects and families. It’s easy to email the links. </span>
</td>
</tr>
</tbody>
</table>
<!-- 1 -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="345" class="column" style="height:100%;display:inline-block;">
<img src="#" style="width:100%">
</td>
</tr>
<tr>
<td width="345" class="column" style="padding-bottom:40px">
<span style="padding-bottom:5px;"><strong>A Conversation to have with your Mom that can’t wait</strong></span>
<br>President, Judy Meleliat speaks candidly about how she approached “the talk” with her own 90 year old mother and offers tips.
</td>
</tr>
<tr>
<td width="345" class="column" style="height:100%;display:inline-block;">
<img src="#" style="width:100%;display:block;">
</td>
</tr>
<tr>
<td height="20"> </td>
</tr>
<tr>
<td width="322" class="column" style="padding-bottom:40px;">
<span style="display:inline-block; padding-bottom:5px;"><strong>Types of assisted living</strong></span>
<br> It’s a struggle to sort through all the information on “types” of senior living. This article helps to clarify the categories for a new family trying to understand.
</td>
</tr>
<tr>
<td width="345" class="column" style="height:100%;display:inline-block;">
<img src="#" style="width:100%;display:block;">
</td>
</tr>
<tr>
<td width="322" class="column" style="padding-bottom:40px;">
<span style="display:inline-block; padding-bottom:5px;"><strong>Is it time to think about assisted living?</strong><span>
<br>
What are the signs that your parent may need help? Dr. Shirley Newell shows you what to look for. How are you holding up as a caregiver?
</td>
</tr>
<tr>
<td width="345" class="column" style="height:100%;display:inline-block;">
<img src="#" style="width:100%;display:block;">
</td>
</tr>
<tr>
<td width="322" class="column" style="padding-bottom:20px;">
<span style="display:inline-block; padding-bottom:5px;"><strong> Advice on paying for assisted living</strong></span>
<br> Various ways to fund assisted living or memory care.
</td>
</tr>
</tbody>
</table>
<!-- new expert advice -->
<!-- epic speaker videos -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">EPIC Speaker Videos Released</span>
</td>
</tr>
</tbody>
</table>
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="345" style="height:100%;display:inline-block;margin-right:17px;" class="column">
<img src="#" style="width:100%;display:block;">
</td>
</tr>
<tr>
<td width="423" class="column" style="padding:20px;">The first packet of EPIC speaker DVD’s are in the General Manager’s hands for all-employee viewing. These videos aim to inspire with messages from world class athletes, politicians, physicians and speakers. This month we suggest you start with
the uplifting message by world record setting swimmer, Diana Nyad recently seen on <em>Dancing with the Stars!</em>
</td>
</tr>
</tbody>
</table>
<!-- epic speaker videos -->
<!-- upcoming events -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td class="top-buffer">
<span class="h1">Upcoming Events/Holidays</span>
</td>
</tr>
</tbody>
</table>
<table width="800" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<!-- <tr>
<td width="100%" height="10"> </td>
</tr>
-->
<tr>
<td width="100%" height="100">
<span style="font-size:17px"><strong>
May is: Physical Fitness Month / Jewish American Heritage Month</strong></span>
<table>
<tbody>
<tr>
<td>
<ul style="line-height: 150%; width: 582px;">
<li style="list-style-type:none; padding-left:10px;background-color:#ededed">May 10th - <span style="font-weight:300">Mother’s Day</span> </li>
<li style="list-style-type:none;padding-left:10px;">May 25th - <span style="font-weight:300">Memorial Day</span> </li>
<li style="list-style-type:none; padding-left:10px; background-color:#ededed">June 6th - <span style="font-weight:300">D-Day</span></li>
<li style="list-style-type:none;padding-left:10px;">June 14th - <span style="font-weight:300">Flag Day</span></li>
<li style="list-style-type:none; padding-left:10px; background-color:#ededed">June 21st - <span style="font-weight:300">Father’s Day</span></li>
<li style="list-style-type:none;padding-left:10px;">June 21st - <span style="font-weight:300">Alzheimer’s Association Longest day (click below for details)</span></li>
</ul>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- alzheimer's -->
<table width="640" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="100%" height="10"> </td>
</tr>
<tr>
<td width="100%" height="100">
<img src="#" style="width:100%;display:block;">
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- alzheimer's -->
<!-- prior -->
<table width="800" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="100%" height="10"> </td>
</tr>
<tr>
<td width="100%" height="100" style="padding:20px;">
<span style="display:inline-block;padding-bottom:5px">
Prior: If you are doing something in your community for the Longest Day, please email Director of Public Relations with a brief description of your plan as soon as you have it finalized.
</span>
<br> During your event, please take photos and send them to John so that we can post on social media and/or send to media to help spread the word. We’re proud of you and your residents. Let us brag.
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- prior-->
<!-- upcoming events -->
<!-- watch out for upcoming events-->
<table width="800" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="100%" height="10"> </td>
</tr>
<tr>
<td class="top-buffer">
<span class="h1" style="display:inline-block;line-height:120%;">WATCH FOR OUR MONTHLY MEDIA REPORT COMING SOON!</span>
</td>
</tr>
<tr>
<td width="100%" height="10"> </td>
</tr>
</tbody>
</table>
<!-- watch out for upcoming events-->
<!-- footer -->
<table width="600" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<tr>
<td width="100%">
<table width="600" cellpadding="0" cellspacing="0" border="0" align="center" class="body_table">
<tbody>
<!-- Spacing -->
<tr>
<td height="20" style="font-size:1px; line-height:1px; mso-line-height-rule: exactly;"> </td>
</tr>
<!-- Spacing -->
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!-- end of footer -->
<!-- end of background table-->
</td>
</tr>
</tbody>
</table>
</body>
</html>
Line 42: font-size: 16px!important; needs a space between the x and !
but also, gmail won't read your style tag. that's why it's standard practice in email to put your font stylings in your <td> as well as an enclosed <font> tag with the face attribute as well as all the style="" CSS from the <td> (it helps with Windows Phone and some versions of Outlook that need a few reminders to render CSS)