You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

213 lines
12 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="sale.action_report_saleorder" model="ir.actions.report">
<field name="name">Quotation / Order</field>
<field name="model">sale.order</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">base_advanced_report_templates.report_saleorder_custom</field>
<field name="report_file">base_advanced_report_templates.report_saleorder</field>
<field name="print_report_name">(object.state in ('draft', 'sent') and 'Quotation - %s' % (object.name)) or 'Order - %s' % (object.name)
</field>
<field name="binding_model_id" ref="model_sale_order"/>
<field name="binding_type">report</field>
</record>
<template id="report_saleorder_custom">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-if="doc.theme_id.name=='Traditional'">
<t t-call="base_advanced_report_templates.report_saleorder_traditional_document"
t-lang="doc.partner_id.lang"/>
</t>
<t t-elif="doc.theme_id.name=='Standard'">
<t t-call="base_advanced_report_templates.report_saleorder_standard_document"
t-lang="doc.partner_id.lang"/>
</t>
<t t-elif="doc.theme_id.name=='Modern'">
<t t-call="base_advanced_report_templates.report_saleorder_modern_document"
t-lang="doc.partner_id.lang"/>
</t>
<t t-elif="doc.theme_id.name=='Attractive'">
<t t-call="base_advanced_report_templates.report_saleorder_attractive_document"
t-lang="doc.partner_id.lang"/>
</t>
<t t-else="">
<t t-call="sale.report_saleorder_document"
t-lang="doc.partner_id.lang"/>
</t>
</t>
</t>
</template>
<!-- Sale order report traditional template-->
<template id="report_saleorder_traditional_document">
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="forced_vat"
t-value="doc.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set -->
<div class="page">
<!-- Is there a discount on at least one line? -->
<t t-set="lines_to_report" t-value="doc._get_order_lines_to_report()"/>
<t t-set="display_discount" t-value="any(l.discount for l in lines_to_report)"/>
<table class="table table-sm o_main_table mt-4">
<!-- In case we want to repeat the header, remove "display: table-row-group" -->
<thead t-attf-style=" background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};">
<tr>
<th name="th_description" class="text-start">Customer Address</th>
<th name="th_priceunit" t-if="doc.state in ['draft', 'sent']" class="text-end">Quotaion Date
</th>
<th name="th_priceunit" t-if="doc.state not in ['draft', 'sent']" class="text-end">Order
Date
</th>
<th name="th_priceunit" t-if="doc.state in ['draft','sent']" class="text-end">Quotaion</th>
<th name="th_priceunit" t-if="doc.state not in ['draft','sent']" class="text-end">Order</th>
</tr>
</thead>
<tbody>
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;">
<td class="text-start">
<div t-field="doc.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
<p t-if="doc.partner_id.vat">
<t t-out="doc.company_id.account_fiscal_country_id.vat_label or 'Tax ID'"/>
:
<span t-field="doc.partner_id.vat"/>
</p>
</td>
<td class="text-end">
<p class="m-0" t-field="doc.date_order" t-options='{"widget": "date"}'/>
</td>
<td class="text-end">
<span t-field="doc.name"/>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<br/>
<table class="table table-sm o_main_table mt-4">
<!-- In case we want to repeat the header, remove "display: table-row-group" -->
<thead t-attf-style=" background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};">
<tr>
<th name="th_description" class="text-start">Description</th>
<th name="th_product" class="text-start">Product</th>
<th name="th_quantity" class="text-end">Quantity</th>
<th name="th_priceunit" class="text-end">Unit Price</th>
<th name="th_discount" t-if="display_discount" class="text-end"
groups="product.group_discount_per_so_line">
<span>Disc.%</span>
</th>
<th name="th_taxes" class="text-end">Taxes</th>
<th name="th_subtotal" class="text-end">
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span>
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span>
</th>
</tr>
</thead>
<tbody class="sale_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-foreach="lines_to_report" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"
groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total"
groups="account.group_show_line_subtotals_tax_included"/>
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;"
t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="not line.display_type">
<td name="td_name">
<span t-field="line.name"/>
</td>
<td name="td_image">
<span t-field="line.order_line_image" t-options='{"widget": "image"}'/>
</td>
<td name="td_quantity" class="text-end">
<span t-field="line.product_uom_qty"/>
<span t-field="line.product_uom"/>
</td>
<td name="td_priceunit" class="text-end">
<span t-field="line.price_unit"/>
</td>
<td t-if="display_discount" class="text-end"
groups="product.group_discount_per_so_line">
<span t-field="line.discount"/>
</td>
<td name="td_taxes" class="text-end">
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/>
</td>
<td t-if="not line.is_downpayment" name="td_subtotal"
class="text-end o_price_total">
<span t-field="line.price_subtotal"
groups="account.group_show_line_subtotals_tax_excluded"/>
<span t-field="line.price_total"
groups="account.group_show_line_subtotals_tax_included"/>
</td>
</t>
<t t-elif="line.display_type == 'line_section'">
<td name="td_section_line" colspan="99">
<span t-field="line.name"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-elif="line.display_type == 'line_note'">
<td name="td_note_line" colspan="99">
<span t-field="line.name"/>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section') and not line.is_downpayment">
<tr class="is-subtotal text-end">
<td name="td_section_subtotal" colspan="99">
<strong class="mr16">Subtotal</strong>
<span
t-out="current_subtotal"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'
/>
</td>
</tr>
</t>
</t>
</tbody>
</table>
<div class="clearfix" name="so_total_summary">
<div id="total" class="row" name="total">
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto">
<table class="table table-sm">
<!-- Tax totals -->
<t t-set="tax_totals" t-value="doc.tax_totals"/>
<t t-call="account.document_tax_totals"/>
</table>
</div>
</div>
</div>
<div t-if="doc.signature" class="mt-4 ml64 mr4" name="signature">
<div class="offset-8">
<strong>Signature</strong>
</div>
<div class="offset-8">
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/>
</div>
<div class="offset-8 text-center">
<p t-field="doc.signed_by"/>
</div>
</div>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
<div>
<div>
<p t-field="doc.note" name="order_note"/>
</div>
<p t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)"
id="fiscal_position_remark">
<strong>Fiscal Position Remark:</strong>
<span t-field="doc.fiscal_position_id.sudo().note"/>
</p>
</div>
</div>
</t>
</template>
</odoo>