Browse Source

Nov 30 : [FIX] Bug Fixed 'base_advanced_report_templates'

pull/295/head
AjmalCybro 1 year ago
parent
commit
af46d94d53
  1. 2
      base_advanced_report_templates/account_custom_templates/account_attractive_template.xml
  2. 15
      base_advanced_report_templates/sale_custom_reports/sale_attractive_template.xml
  3. 74
      base_advanced_report_templates/sale_custom_reports/sale_modern_template.xml
  4. 57
      base_advanced_report_templates/sale_custom_reports/sale_standrd_template.xml
  5. 31
      base_advanced_report_templates/sale_custom_reports/sale_traditional_template.xml

2
base_advanced_report_templates/account_custom_templates/account_attractive_template.xml

@ -107,8 +107,6 @@
<br/> <br/>
<br/> <br/>
<br/> <br/>
<t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/> <t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/>
<table class="table table-sm o_main_table" name="invoice_line_table"> <table class="table table-sm o_main_table" name="invoice_line_table">

15
base_advanced_report_templates/sale_custom_reports/sale_attractive_template.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<template id="report_saleorder_attractive_document"> <template id="report_saleorder_attractive_document">
<t t-call="web.external_layout">
<t t-if="doc and 'company_id' in doc"> <t t-if="doc and 'company_id' in doc">
<t t-set="company" t-value="doc.company_id"/> <t t-set="company" t-value="doc.company_id"/>
</t> </t>
@ -33,8 +34,6 @@
</div> </div>
</div> </div>
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/> <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="forced_vat" <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 --> 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 -->
@ -42,29 +41,27 @@
<h1 t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> <h1 t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};">
<div class="row mt-4 mb-4" 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" <div t-if="doc.client_order_ref" class="col-auto col-3 mw-100 mb-2"
name="informations_reference"> name="informations_reference" style="font-size: 25px;">
<strong>Your Reference:</strong> <strong>Your Reference:</strong>
<p class="m-0" t-field="doc.client_order_ref"/> <p class="m-0" t-field="doc.client_order_ref"/>
</div> </div>
<div t-if="doc.date_order" class="col-auto col-3 mw-100 mb-2" name="informations_date"> <div t-if="doc.date_order" class="col-auto col-2 mw-100 mb-2" name="informations_date" style="font-size: 25px;">
<strong t-if="doc.state in ['draft', 'sent']">Quotation Date:</strong> <strong t-if="doc.state in ['draft', 'sent']">Quotation Date:</strong>
<strong t-else="">Order Date:</strong> <strong t-else="" >Order Date:</strong>
<p class="m-0" t-field="doc.date_order" t-options='{"widget": "date"}'/> <p class="m-0" t-field="doc.date_order" t-options='{"widget": "date"}'/>
</div> </div>
<div t-if="doc.validity_date and doc.state in ['draft', 'sent']" <div t-if="doc.validity_date and doc.state in ['draft', 'sent']"
class="col-auto col-3 mw-100 mb-2" class="col-auto col-3 mw-100 mb-2"
name="expiration_date"> name="expiration_date" style="font-size: 25px;">
<strong>Expiration:</strong> <strong>Expiration:</strong>
<p class="m-0" t-field="doc.validity_date"/> <p class="m-0" t-field="doc.validity_date"/>
</div> </div>
<div t-if="doc.user_id.name" class="col-auto col-3 mw-100 mb-2"> <div t-if="doc.user_id.name" class="col-auto col-3 mw-100 mb-2" style="font-size: 25px;">
<strong>Salesperson:</strong> <strong>Salesperson:</strong>
<p class="m-0" t-field="doc.user_id"/> <p class="m-0" t-field="doc.user_id"/>
</div> </div>
</div> </div>
</h1> </h1>
<table class="table table-sm o_main_table mt-4"> <table class="table table-sm o_main_table mt-4">
<thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> <thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};">
<th t-if="doc.state not in ['draft','sent']">Customer</th> <th t-if="doc.state not in ['draft','sent']">Customer</th>

74
base_advanced_report_templates/sale_custom_reports/sale_modern_template.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<template id="report_saleorder_modern_document"> <template id="report_saleorder_modern_document">
<t t-call="web.external_layout">
<t t-if="doc and 'company_id' in doc"> <t t-if="doc and 'company_id' in doc">
<t t-set="company" t-value="doc.company_id"/> <t t-set="company" t-value="doc.company_id"/>
</t> </t>
@ -11,7 +12,8 @@
<div class="page-header col-12"> <div class="page-header col-12">
<div t-attf-class="pull-left"> <div t-attf-class="pull-left">
<t t-if="company.logo"> <t t-if="company.logo">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" <img t-if="company.logo"
t-att-src="image_data_uri(company.logo)"
style="max-height: 80px;"/> style="max-height: 80px;"/>
</t> </t>
</div> </div>
@ -32,9 +34,8 @@
</div> </div>
</div> </div>
</div> </div>
<t t-call="web.external_layout"> <t t-set="doc"
t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="forced_vat" <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 --> 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 -->
<table class="table table-sm o_main_table mt-4"> <table class="table table-sm o_main_table mt-4">
@ -56,7 +57,8 @@
</t> </t>
</t> </t>
<t t-else=""> <t t-else="">
<th name="th_priceunit" t-if="doc.partner_shipping_id != doc.partner_invoice_id" <th name="th_priceunit"
t-if="doc.partner_shipping_id != doc.partner_invoice_id"
class="text-end"> class="text-end">
Invoicing Address Invoicing Address
</th> </th>
@ -89,8 +91,6 @@
</tbody> </tbody>
</table> </table>
<h1 class="mt-4" <h1 class="mt-4"
t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};">
<span t-if="env.context.get('proforma', False) or is_pro_forma"> <span t-if="env.context.get('proforma', False) or is_pro_forma">
@ -103,47 +103,60 @@
<strong>Order #</strong> <strong>Order #</strong>
</span> </span>
<span t-field="doc.name"/> <span t-field="doc.name"/>
<span t-if="doc.date_order" class="col-auto col-3 mw-100 mb-2"
name="informations_date">
<span t-if="doc.date_order" class="col-auto col-3 mw-100 mb-2" name="informations_date"> <strong t-if="doc.state in ['draft', 'sent']">Quotation
<strong t-if="doc.state in ['draft', 'sent']">Quotation Date:</strong> Date:
</strong>
<strong t-else="">Order Date:</strong> <strong t-else="">Order Date:</strong>
<span class="m-0" t-field="doc.date_order" t-options='{"widget": "date"}'/> <span class="m-0" t-field="doc.date_order"
t-options='{"widget": "date"}'/>
</span> </span>
<span t-if="not is_html_empty(doc.payment_term_id.note)"> <span t-if="not is_html_empty(doc.payment_term_id.note)">
<span t-field="doc.payment_term_id.note"/> <span t-field="doc.payment_term_id.note"/>
</span> </span>
<span t-if="doc.user_id.name" class="col-auto col-3 mw-100 mb-2"> <span t-if="doc.user_id.name"
class="col-auto col-3 mw-100 mb-2">
<strong>Salesperson:</strong> <strong>Salesperson:</strong>
<span t-field="doc.user_id"/> <span t-field="doc.user_id"/>
</span> </span>
</h1> </h1>
<div class="page"> <div class="page">
<div class="oe_structure"/> <div class="oe_structure"/>
<!-- Is there a discount on at least one line? --> <!-- 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="lines_to_report"
<t t-set="display_discount" t-value="any(l.discount for l in 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"> <table class="table table-sm o_main_table mt-4">
<!-- In case we want to repeat the header, remove "display: table-row-group" --> <!-- 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};"> <thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};">
<tr> <tr>
<th name="th_description" class="text-start">Description</th> <th name="th_description" class="text-start">
<th name="th_quantity" class="text-end">Quantity</th> Description
<th name="th_priceunit" class="text-end">Unit Price</th> </th>
<th name="th_discount" t-if="display_discount" class="text-end" <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"> groups="product.group_discount_per_so_line">
<span>Disc.%</span> <span>Disc.%</span>
</th> </th>
<th name="th_taxes" class="text-end">Taxes</th> <th name="th_taxes" class="text-end">Taxes</th>
<th name="th_subtotal" class="text-end"> <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_excluded">
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span> Amount
</span>
<span groups="account.group_show_line_subtotals_tax_included">
Total Price
</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -153,9 +166,11 @@
<t t-foreach="lines_to_report" t-as="line"> <t t-foreach="lines_to_report" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" <t t-set="current_subtotal"
t-value="current_subtotal + line.price_subtotal"
groups="account.group_show_line_subtotals_tax_excluded"/> groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" <t t-set="current_subtotal"
t-value="current_subtotal + line.price_total"
groups="account.group_show_line_subtotals_tax_included"/> groups="account.group_show_line_subtotals_tax_included"/>
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;" <tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;"
@ -178,7 +193,8 @@
<td name="td_taxes" class="text-end"> <td name="td_taxes" class="text-end">
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/> <span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/>
</td> </td>
<td t-if="not line.is_downpayment" name="td_subtotal" <td t-if="not line.is_downpayment"
name="td_subtotal"
class="text-end o_price_total"> class="text-end o_price_total">
<span t-field="line.price_subtotal" <span t-field="line.price_subtotal"
groups="account.group_show_line_subtotals_tax_excluded"/> groups="account.group_show_line_subtotals_tax_excluded"/>
@ -234,12 +250,14 @@
<br/> <br/>
<br></br> <br></br>
<div t-if="doc.signature" class="mt-4 ml64 mr4" name="signature"> <div t-if="doc.signature" class="mt-4 ml64 mr4"
name="signature">
<div class="offset-8"> <div class="offset-8">
<strong>Signature</strong> <strong>Signature</strong>
</div> </div>
<div class="offset-8"> <div class="offset-8">
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/> <img t-att-src="image_data_uri(doc.signature)"
style="max-height: 4cm; max-width: 8cm;"/>
</div> </div>
<div class="offset-8 text-center"> <div class="offset-8 text-center">
<p t-field="doc.signed_by"/> <p t-field="doc.signed_by"/>

57
base_advanced_report_templates/sale_custom_reports/sale_standrd_template.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<template id="report_saleorder_standard_document"> <template id="report_saleorder_standard_document">
<t t-call="web.external_layout">
<t t-if="doc and 'company_id' in doc"> <t t-if="doc and 'company_id' in doc">
<t t-set="company" t-value="doc.company_id"/> <t t-set="company" t-value="doc.company_id"/>
</t> </t>
@ -11,7 +12,8 @@
<div class="page-header col-12"> <div class="page-header col-12">
<div t-attf-class="pull-left"> <div t-attf-class="pull-left">
<t t-if="company.logo"> <t t-if="company.logo">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" <img t-if="company.logo"
t-att-src="image_data_uri(company.logo)"
style="max-height: 80px;"/> style="max-height: 80px;"/>
</t> </t>
</div> </div>
@ -32,15 +34,16 @@
</div> </div>
</div> </div>
</div> </div>
<t t-call="web.external_layout"> <t t-set="doc"
t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="forced_vat" <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 --> 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 -->
<h1 class="mt-4 col-12" <h1 class="mt-4 col-12"
t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};"> t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};">
<span t-if="env.context.get('proforma', False) or is_pro_forma">Pro-Forma Invoice #</span> <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-elif="doc.state in ['draft','sent']">Quotation #</span>
<span t-else="">Order #</span> <span t-else="">Order #</span>
<span t-field="doc.name"/> <span t-field="doc.name"/>
@ -84,24 +87,36 @@
<div class="oe_structure"/> <div class="oe_structure"/>
<!-- Is there a discount on at least one line? --> <!-- 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="lines_to_report"
<t t-set="display_discount" t-value="any(l.discount for l in 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"> <table class="table table-sm o_main_table mt-4">
<!-- In case we want to repeat the header, remove "display: table-row-group" --> <!-- 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};"> <thead t-attf-style="background-color:#{doc.theme_id.base_color};color:#{doc.theme_id.heading_text_color};">
<tr> <tr>
<th name="th_description" class="text-start">Description</th> <th name="th_description" class="text-start">
<th name="th_quantity" class="text-end">Quantity</th> Description
<th name="th_priceunit" class="text-end">Unit Price</th> </th>
<th name="th_discount" t-if="display_discount" class="text-end" <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"> groups="product.group_discount_per_so_line">
<span>Disc.%</span> <span>Disc.%</span>
</th> </th>
<th name="th_taxes" class="text-end">Taxes</th> <th name="th_taxes" class="text-end">Taxes</th>
<th name="th_subtotal" class="text-end"> <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_excluded">
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span> Amount
</span>
<span groups="account.group_show_line_subtotals_tax_included">
Total Price
</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -111,9 +126,11 @@
<t t-foreach="lines_to_report" t-as="line"> <t t-foreach="lines_to_report" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" <t t-set="current_subtotal"
t-value="current_subtotal + line.price_subtotal"
groups="account.group_show_line_subtotals_tax_excluded"/> groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" <t t-set="current_subtotal"
t-value="current_subtotal + line.price_total"
groups="account.group_show_line_subtotals_tax_included"/> groups="account.group_show_line_subtotals_tax_included"/>
<tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;" <tr t-attf-style="color:#{doc.theme_id.customer_text_color} !important;"
@ -136,7 +153,8 @@
<td name="td_taxes" class="text-end"> <td name="td_taxes" class="text-end">
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/> <span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/>
</td> </td>
<td t-if="not line.is_downpayment" name="td_subtotal" <td t-if="not line.is_downpayment"
name="td_subtotal"
class="text-end o_price_total"> class="text-end o_price_total">
<span t-field="line.price_subtotal" <span t-field="line.price_subtotal"
groups="account.group_show_line_subtotals_tax_excluded"/> groups="account.group_show_line_subtotals_tax_excluded"/>
@ -186,12 +204,14 @@
</div> </div>
</div> </div>
<div t-if="doc.signature" class="mt-4 ml64 mr4" name="signature"> <div t-if="doc.signature" class="mt-4 ml64 mr4"
name="signature">
<div class="offset-8"> <div class="offset-8">
<strong>Signature</strong> <strong>Signature</strong>
</div> </div>
<div class="offset-8"> <div class="offset-8">
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/> <img t-att-src="image_data_uri(doc.signature)"
style="max-height: 4cm; max-width: 8cm;"/>
</div> </div>
<div class="offset-8 text-center"> <div class="offset-8 text-center">
<p t-field="doc.signed_by"/> <p t-field="doc.signed_by"/>
@ -218,5 +238,4 @@
</div> </div>
</t> </t>
</template> </template>
</odoo> </odoo>

31
base_advanced_report_templates/sale_custom_reports/sale_traditional_template.xml

@ -40,37 +40,6 @@
</template> </template>
<template id="report_saleorder_traditional_document"> <template id="report_saleorder_traditional_document">
<t t-if="doc and 'company_id' in doc">
<t t-set="company" t-value="doc.company_id"/>
</t>
<t t-if="not doc or not 'company_id' in doc">
<t t-set="company" t-value="res_company"/>
</t>
<div class="header row mt32 mb32">
<div class="page-header col-12">
<div t-attf-class="pull-left">
<t t-if="company.logo">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)"
style="max-height: 80px;"/>
</t>
</div>
<div t-attf-class="pull-left"
t-attf-style="font:14px lucida-console,sans-serif; color:#{doc.theme_id.company_text_color} !important;">
<span t-field="company.partner_id"/>
<br/>
<span t-field="company.partner_id.street"/>
<br/>
<span t-field="company.partner_id.street2"/>
<br/>
<span t-field="company.partner_id.city"/>
<br/>
<span t-field="company.partner_id.country_id"/>
<br/>
<span t-field="company.partner_id.vat"/>
<br/>
</div>
</div>
</div>
<t t-call="web.external_layout"> <t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/> <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>

Loading…
Cancel
Save