Browse Source

Apr 03: [FIX] Bug Fixed 'invoice_format_editor'

pull/195/merge
RisvanaCybro 1 year ago
parent
commit
46eb66a708
  1. 2
      invoice_format_editor/__manifest__.py
  2. 5
      invoice_format_editor/doc/RELEASE_NOTES.md
  3. 94
      invoice_format_editor/reports/custom_invoice_template.xml
  4. 91
      invoice_format_editor/reports/custom_invoice_template_fantacy.xml
  5. 196
      invoice_format_editor/reports/custom_invoice_template_old_standard.xml

2
invoice_format_editor/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Invoice Format Editor',
'version': '15.0.1.0.1',
'version': '15.0.1.1.1',
'category': 'Accounting',
'summary': 'Invoice Format Editor',
'description': """Invoice Format Editor For Configuring the Invoice Templates""",

5
invoice_format_editor/doc/RELEASE_NOTES.md

@ -10,3 +10,8 @@
#### UPDT AND BUGFIX
- Invoice printing issue
#### 03.04.2024
#### Version 15.0.1.1.1
##### UPDATE
- Bug Fix-Resolved the attribute error, updated the report templates

94
invoice_format_editor/reports/custom_invoice_template.xml

@ -102,28 +102,8 @@
<tr>
<td>
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id"/>
t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
<br/>
<span t-if="o.theme_id.address">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
<br/>
</span>
<span t-if="o.theme_id.city">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
<br/>
</span>
<span t-if="o.theme_id.country">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
<br/>
</span>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.vat"/>
<br/>
@ -179,7 +159,7 @@
</tr>
</table>
<div class="page">
<div t-attf-style="padding:2%">
<div>
<h2>
<center>
<span t-if="o.move_type == 'out_invoice' and (o.state == 'draft' or o.state == 'posted')">
@ -318,11 +298,13 @@
</tbody>
</table>
</div>
<div>
<div class="clearfix mb-4">
<div class="col-4 pull-right">
<table class="table table-condensed">
<t t-set="tax_totals" t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<t t-set="tax_totals"
t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']"
t-as="subtotal">
<tr class="border-black o_subtotal">
<td>
<strong t-esc="subtotal['name']"/>
@ -337,7 +319,8 @@
</td>
</tr>
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
<t t-set="subtotal_to_show"
t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals"/>
</t>
@ -353,60 +336,52 @@
</tr>
</table>
</div>
</div>
<div style="padding-top:10%;" class="col-12">
<p t-if="not is_html_empty(o.narration)">
<strong>Comment:</strong>
<span t-field="o.narration"/>
</p>
<p t-if="o.fiscal_position_id.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="o.fiscal_position_id.note"/>
</p>
<br/>
<br/>
<p t-if="o.move_type in ('out_invoice','in_refund')">
<div style="padding-top:15%;" class="col-12">
<p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference"
name="payment_communication">
Please use the following communication for your
payment :
<b>
<span t-field="o.payment_reference"/>
</b>
</p>
<p t-if="o.invoice_payment_term_id" name="payment_term">
<p t-if="o.invoice_payment_term_id"
name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
<p t-if="o.fiscal_position_id.note" name="note">
<div t-if="not is_html_empty(o.narration)"
name="comment">
<span t-field="o.narration"/>
</div>
<p t-if="not is_html_empty(o.fiscal_position_id.note)"
name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<t t-if="o.company_id.country_id.code == 'IN'">
<p id="total_in_words" class="mb16">
<strong>Total (In Words):</strong>
<span t-field="o.amount_total_words"/>
<p t-if="o.invoice_incoterm_id" name="incoterm">
<strong>Incoterm:</strong>
<span t-field="o.invoice_incoterm_id.code"/>
-
<span t-field="o.invoice_incoterm_id.name"/>
</p>
</t>
<div id="qrcode"
t-if="(o.company_id.qr_code) and (o.currency_id.name == 'EUR') and (o.invoice_partner_bank_id.acc_number != False)">
<p t-if="(o.invoice_partner_bank_id.qr_code_valid)">
<strong class="text-center">Scan me with your
banking app.
t-if="o.display_qr_code and o.amount_residual > 0">
<p t-if="qr_code_urls.get(o.id)">
<strong class="text-center">Scan me with
your banking app.
</strong>
<br/>
<br/>
<img class="border border-dark rounded"
t-att-src="o.invoice_partner_bank_id.build_qr_code_url(o.amount_residual, o.ref or o.name)"/>
</p>
<p t-if="(o.invoice_partner_bank_id.qr_code_valid == False)">
<strong class="text-center">The SEPA QR Code
informations are not set correctly.
</strong>
<br/>
t-att-src="qr_code_urls[o.id]"/>
</p>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="report_invoice_with_payments_inherit" inherit_id="account.report_invoice_with_payments">
<template id="report_invoice_with_payments_inherit"
inherit_id="account.report_invoice_with_payments">
<xpath expr="//t[@t-call='web.html_container']" position="replace">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
@ -433,7 +408,8 @@
</t>
</xpath>
</template>
<template id="report_invoice_inherit" inherit_id="account.report_invoice">
<template id="report_invoice_inherit"
inherit_id="account.report_invoice">
<xpath expr="//t[@t-call='web.html_container']" position="replace">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">

91
invoice_format_editor/reports/custom_invoice_template_fantacy.xml

@ -130,25 +130,7 @@
<strong>Customer Address</strong>
<br/>
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id"/>
<br/>
<span t-if="o.theme_id.address">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
<br/>
</span>
<span t-if="o.theme_id.city">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
</span>
<br/>
<span t-if="o.theme_id.country">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
</span>
t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.vat"/>
@ -251,11 +233,13 @@
</tbody>
</table>
</div>
<div>
<div class="clearfix mb-4">
<div class="col-4 pull-right">
<table class="table table-condensed">
<t t-set="tax_totals" t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<t t-set="tax_totals"
t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']"
t-as="subtotal">
<tr class="border-black o_subtotal">
<td>
<strong t-esc="subtotal['name']"/>
@ -270,7 +254,8 @@
</td>
</tr>
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
<t t-set="subtotal_to_show"
t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals"/>
</t>
@ -280,64 +265,54 @@
<strong>Total</strong>
</td>
<td class="text-right">
<span t-esc="tax_totals['amount_total']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<span t-esc="tax_totals['amount_total']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
</div>
</div>
<div style="padding-top:10%;" class="col-12">
<p t-if="not is_html_empty(o.narration)">
<strong>Comment:</strong>
<span t-field="o.narration"/>
</p>
<p t-if="o.fiscal_position_id.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="o.fiscal_position_id.note"/>
</p>
<br/>
<br/>
<p t-if="o.move_type in ('out_invoice','in_refund')">
<div style="padding-top:15%;" class="col-12">
<p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference"
name="payment_communication">
Please use the following communication for your
payment
:
payment :
<b>
<span t-field="o.payment_reference"/>
</b>
</p>
<p t-if="o.invoice_payment_term_id" name="payment_term">
<p t-if="o.invoice_payment_term_id"
name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
<p t-if="o.fiscal_position_id.note" name="note">
<div t-if="not is_html_empty(o.narration)"
name="comment">
<span t-field="o.narration"/>
</div>
<p t-if="not is_html_empty(o.fiscal_position_id.note)"
name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<t t-if="o.company_id.country_id.code == 'IN'">
<p id="total_in_words" class="mb16">
<strong>Total (In Words):</strong>
<span t-field="o.amount_total_words"/>
<p t-if="o.invoice_incoterm_id" name="incoterm">
<strong>Incoterm:</strong>
<span t-field="o.invoice_incoterm_id.code"/>
-
<span t-field="o.invoice_incoterm_id.name"/>
</p>
</t>
<div id="qrcode"
t-if="(o.company_id.qr_code) and (o.currency_id.name == 'EUR') and (o.invoice_partner_bank_id.acc_number != False)">
<p t-if="(o.invoice_partner_bank_id.qr_code_valid)">
<strong class="text-center">Scan me with your
banking app.
t-if="o.display_qr_code and o.amount_residual > 0">
<p t-if="qr_code_urls.get(o.id)">
<strong class="text-center">Scan me with
your banking app.
</strong>
<br/>
<br/>
<img class="border border-dark rounded"
t-att-src="o.invoice_partner_bank_id.build_qr_code_url(o.amount_residual, o.ref or o.name)"/>
</p>
<p t-if="(o.invoice_partner_bank_id.qr_code_valid == False)">
<strong class="text-center">The SEPA QR Code
informations are not set
correctly.
</strong>
<br/>
t-att-src="qr_code_urls[o.id]"/>
</p>
</div>
</div>
</div>
</div>
</t>
</template>
</data>

196
invoice_format_editor/reports/custom_invoice_template_old_standard.xml

@ -15,60 +15,36 @@
t-att-src="'data:image/png;base64,%s' % to_text(company.logo)"
style="max-height: 80px;"/>
</div>
<div t-attf-class="pull-#{o.theme_id.company_position} "
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.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-set="o"
t-value="o.with_context({'lang':o.partner_id.lang})"/>
<div class="page">
<div class=" row mt32 mb32">
<div class="col-12" style="padding-top:20px;">
<div t-attf-class=" pull-#{o.theme_id.customer_position} text-#{o.theme_id.customer_position}"
style="font:15px lucida-console,sans-serif !important;">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id"/>
<br/>
<span t-if="o.theme_id.address">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
</span>
<br/>
<span t-if="o.theme_id.city">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
</span>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.state_id"/>
<br/>
<span t-if="o.theme_id.country">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
<div id="customer_address"
t-attf-style="color:#{o.theme_id.customer_text_color}">
<div class="row">
<div t-attf-class="col-12 text-#{o.theme_id.customer_position} ">
<div itemprop="address" class="address">
<div>
<span t-if="o.partner_id">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</span>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
</div>
<div>
<span t-if="o.partner_id.vat">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.vat"/>
<br/>
</span>
</div>
</div>
</div>
</div>
</div>
<div t-attf-class="pull-right"
<br/>
<div class="page">
<div
t-attf-style="font:15px lucida-console,sans-serif !important;background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};padding:2%">
<h2>
<span t-if="o.move_type == 'out_invoice' and (o.state == 'draft' or o.state == 'posted')">
@ -111,31 +87,69 @@
<span t-field="o.name"/>
</font>
</h2>
<div t-if="o.invoice_date">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<strong>Invoice Date:</strong>
<p t-field="o.invoice_date"/>
</font>
<br/>
<div id="invoice_information">
<div class="row mt32 mb32" id="informations">
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.invoice_date"
name="invoice_date">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Invoice Date:
</strong>
<p class="m-0"
t-attf-style="color:#{o.theme_id.text_color}"
t-field="o.invoice_date"/>
</div>
<div t-if="o.name">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<strong>Due Date:</strong>
<p t-field="o.invoice_date_due"/>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'"
name="due_date">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Due Date:
</strong>
<p class="m-0"
t-attf-style="color:#{o.theme_id.text_color}"
t-field="o.invoice_date_due"/>
</div>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.invoice_payment_term_id"
name="payment_term">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Payment Term:
</strong>
<p class="m-0"
t-attf-style="color:#{o.theme_id.text_color}"
t-field="o.invoice_payment_term_id"/>
</div>
<!--optional information-->
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.user_id">
<div t-if="o.theme_id.sales_person">
<font t-attf-style="color:#{o.theme_id.text_color}">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Sales Person:
</strong>
<p t-field="o.user_id"/>
</font>
</div>
</div>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.ref">
<div t-if="o.theme_id.reference">
<div t-if="o.ref">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<strong>Reference:</strong>
<font t-attf-style="color:#{o.theme_id.text_color}">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Customer Reference:
</strong>
<p t-field="o.ref"/>
</font>
</div>
</div>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.invoice_origin">
<div t-if="o.theme_id.source">
<div t-if="o.invoice_origin">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<strong>Source:</strong>
<font t-attf-style="color:#{o.theme_id.text_color}">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Source:
</strong>
<p t-field="o.invoice_origin"/>
</font>
</div>
@ -164,7 +178,8 @@
Unit Price
</th>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}"
t-if="display_discount" class="text-right"
t-if="display_discount"
class="text-right"
groups="sale.group_discount_per_so_line">
Disc.(%)
</th>
@ -205,18 +220,21 @@
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_ids))"/>
</td>
</span>
<td class="text-right" t-if="l.price_subtotal">
<td class="text-right"
t-if="l.price_subtotal">
<span t-field="l.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
</tr>
</tbody>
</table>
<div>
<div class="clearfix mb-4">
<div class="col-4 pull-right">
<table class="table table-condensed">
<t t-set="tax_totals" t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<t t-set="tax_totals"
t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']"
t-as="subtotal">
<tr class="border-black o_subtotal">
<td>
<strong t-esc="subtotal['name']"/>
@ -231,7 +249,8 @@
</td>
</tr>
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
<t t-set="subtotal_to_show"
t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals"/>
</t>
@ -257,12 +276,49 @@
</tr>
</table>
</div>
<div style="padding-top:15%;" class="col-12">
<p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference"
name="payment_communication">
Please use the following communication for
your
payment :
<b>
<span t-field="o.payment_reference"/>
</b>
</p>
<p t-if="o.invoice_payment_term_id"
name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
<div t-if="not is_html_empty(o.narration)"
name="comment">
<span t-field="o.narration"/>
</div>
<p t-if="not is_html_empty(o.fiscal_position_id.note)"
name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<p t-if="o.invoice_incoterm_id" name="incoterm">
<strong>Incoterm:</strong>
<span t-field="o.invoice_incoterm_id.code"/>
-
<span t-field="o.invoice_incoterm_id.name"/>
</p>
<div id="qrcode"
t-if="o.display_qr_code and o.amount_residual > 0">
<p t-if="qr_code_urls.get(o.id)">
<strong class="text-center">Scan me with
your banking app.
</strong>
<br/>
<br/>
<br/>
<br/>
<br/>
<img class="border border-dark rounded"
t-att-src="qr_code_urls[o.id]"/>
</p>
</div>
</div>
</div>
</div>
</div>
</t>
</template>

Loading…
Cancel
Save