[IMP] *: better margin in pdf reports

*: account, purchase, sale

Aim of this commit :
Get multiple pdfs reports to be more easily read, such as :
- pro-forma invoice
- quotation/order
- purchase order
- request for quotation
- invoices

After this commit :
Spaces have been added in order to improve readability

closes odoo/odoo#82277

Taskid: 2712478
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Dossogne Bertrand
2022-02-16 14:01:53 +00:00
parent e54ea32283
commit 8d1dc3f9db
4 changed files with 19 additions and 17 deletions
+4 -4
View File
@@ -16,12 +16,12 @@
<div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' groups="account.group_delivery_invoice_address"/>
<t t-set="address">
<address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' groups="!account.group_delivery_invoice_address"/>
<div t-if="o.partner_id.vat" class="mt16">
<div t-if="o.partner_id.vat" class="mt-2">
<t t-if="o.company_id.account_fiscal_country_id.vat_label" t-esc="o.company_id.account_fiscal_country_id.vat_label" id="inv_tax_id_label"/>
<t t-else="">Tax ID</t>: <span t-field="o.partner_id.vat"/></div>
</t>
<div class="page">
<h2>
<h2 class="mt-4">
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">Invoice</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
@@ -31,7 +31,7 @@
<span t-if="o.name != '/'" t-field="o.name"/>
</h2>
<div id="informations" class="row mt32 mb32">
<div id="informations" class="row mt-4 mb-4">
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_date" name="invoice_date">
<strong>Invoice Date:</strong>
<p class="m-0" t-field="o.invoice_date"/>
@@ -130,7 +130,7 @@
</tbody>
</table>
<div class="clearfix">
<div class="clearfix mb-4">
<div id="total" class="row">
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ml-auto">
<table class="table table-sm" style="page-break-inside: avoid;">
@@ -21,11 +21,13 @@
<div class="page">
<div class="oe_structure"/>
<h2 t-if="o.state in ['draft', 'sent', 'to approve']">Request for Quotation #<span t-field="o.name"/></h2>
<h2 t-if="o.state in ['purchase', 'done']">Purchase Order #<span t-field="o.name"/></h2>
<h2 t-if="o.state == 'cancel'">Cancelled Purchase Order #<span t-field="o.name"/></h2>
<div class="mt-4">
<h2 t-if="o.state in ['draft', 'sent', 'to approve']">Request for Quotation #<span t-field="o.name"/></h2>
<h2 t-if="o.state in ['purchase', 'done']">Purchase Order #<span t-field="o.name"/></h2>
<h2 t-if="o.state == 'cancel'">Cancelled Purchase Order #<span t-field="o.name"/></h2>
</div>
<div id="informations" class="row mt32 mb32">
<div id="informations" class="row mt-4 mb32">
<div t-if="o.user_id" class="col-3 bm-2">
<strong>Purchase Representative:</strong>
<p t-field="o.user_id" class="m-0"/>
@@ -44,7 +46,7 @@
</div>
</div>
<table class="table table-sm o_main_table">
<table class="table table-sm o_main_table mt-4">
<thead>
<tr>
<th name="th_description"><strong>Description</strong></th>
@@ -121,7 +123,7 @@
</div>
</div>
<p t-field="o.notes"/>
<p t-field="o.notes" class="mt-4"/>
<div class="oe_structure"/>
</div>
</t>
@@ -19,9 +19,9 @@
<div class="page">
<div class="oe_structure"/>
<h2>Request for Quotation <span t-field="o.name"/></h2>
<h2 class="mt-4">Request for Quotation <span t-field="o.name"/></h2>
<table class="table table-sm">
<table class="table table-sm mt-4">
<thead>
<tr>
<th name="th_description"><strong>Description</strong></th>
@@ -54,7 +54,7 @@
</tbody>
</table>
<p t-field="o.notes"/>
<p t-field="o.notes" class="mt-4"/>
<div class="oe_structure"/>
</div>
@@ -33,14 +33,14 @@
<div class="page">
<div class="oe_structure"/>
<h2 class="mt16">
<h2 class="mt-4">
<span t-if="env.context.get('proforma', False) or is_pro_forma">Pro-Forma Invoice # </span>
<span t-elif="doc.state in ['draft','sent']">Quotation # </span>
<span t-else="">Order # </span>
<span t-field="doc.name"/>
</h2>
<div class="row mt32 mb32" id="informations">
<div class="row mt-4 mb-4" id="informations">
<div t-if="doc.client_order_ref" class="col-auto col-3 mw-100 mb-2" name="informations_reference">
<strong>Your Reference:</strong>
<p class="m-0" t-field="doc.client_order_ref"/>
@@ -65,7 +65,7 @@
<!-- Is there a discount on at least one line? -->
<t t-set="display_discount" t-value="any(l.discount for l in doc.order_line)"/>
<table class="table table-sm o_main_table">
<table class="table table-sm o_main_table mt-4">
<!-- In case we want to repeat the header, remove "display: table-row-group" -->
<thead style="display: table-row-group">
<tr>
@@ -153,7 +153,7 @@
</div>
</div>
<div t-if="doc.signature" class="mt32 ml64 mr4" name="signature">
<div t-if="doc.signature" class="mt-4 ml64 mr4" name="signature">
<div class="offset-8">
<strong>Signature</strong>
</div>