Currently we distinguish customer invoice titles based on the state they are in: draft, posted or cancelled. For the customer credit notes we did not have this dinstinction. This fix makes sure that the title of a credit note is also adapted based on its state. [task-3067251](https://www.odoo.com/web#id=3067251&cids=1&menu_id=4720&action=4043&model=project.task&view_type=form) closes odoo/odoo#106692 Related: odoo/enterprise#34464 Signed-off-by: John Laterre (jol) <jol@odoo.com>
59 lines
3.0 KiB
XML
59 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<template id="l10n_in_report_invoice_document_inherit" inherit_id="account.report_invoice_document">
|
|
|
|
<xpath expr="//address[@t-field='o.partner_id']" position="attributes">
|
|
<attribute name="t-if">o.company_id.account_fiscal_country_id.code != 'IN'</attribute>
|
|
</xpath>
|
|
<xpath expr="//address[@t-field='o.partner_id']" position="after">
|
|
<span t-field="o.l10n_in_gstin" t-if="o.company_id.account_fiscal_country_id.code == 'IN'"/>
|
|
</xpath>
|
|
<xpath expr="//t[@t-set='address']" position="inside">
|
|
<t t-if="o.company_id.account_fiscal_country_id.code == 'IN' and o.l10n_in_state_id" class="mt16">
|
|
<t t-if="o.move_type in ('in_invoice', 'in_refund')">
|
|
Destination of supply: <span t-out="o.l10n_in_state_id.name"/>
|
|
</t>
|
|
<t t-if="o.move_type in ('out_invoice', 'out_refund')">
|
|
Place of supply: <span t-out="o.l10n_in_state_id.name"/>
|
|
</t>
|
|
</t>
|
|
</xpath>
|
|
<xpath expr="//div[@t-if='not is_html_empty(o.narration)']" position="before">
|
|
<t t-if="o.company_id.account_fiscal_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>
|
|
</xpath>
|
|
|
|
<xpath expr="//table[@name='invoice_line_table']/thead/tr/th[1]" position="after">
|
|
<t t-if="o.company_id.account_fiscal_country_id.code == 'IN'">
|
|
<th>HSN/SAC</th>
|
|
</t>
|
|
</xpath>
|
|
|
|
<xpath expr="//t[@name='account_invoice_line_accountable']/td[1]" position="after">
|
|
<td t-if="o.company_id.account_fiscal_country_id.code == 'IN'">
|
|
<span t-if="line.product_id.l10n_in_hsn_code" t-field="line.product_id.l10n_in_hsn_code"></span>
|
|
</td>
|
|
</xpath>
|
|
|
|
<xpath expr="//h2" position="replace">
|
|
<h2>
|
|
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'" t-field="o.journal_id.name"/>
|
|
<span t-elif="o.move_type == 'out_invoice' and o.state == 'draft'">Draft <span t-field="o.journal_id.name"/></span>
|
|
<span t-elif="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled <span t-field="o.journal_id.name"/></span>
|
|
<span t-elif="o.move_type == 'out_refund' and o.state == 'posted'">Credit Note</span>
|
|
<span t-elif="o.move_type == 'out_refund' and o.state == 'draft'">Draft Credit Note</span>
|
|
<span t-elif="o.move_type == 'out_refund' and o.state == 'cancel'">Cancelled Credit Note</span>
|
|
<span t-elif="o.move_type == 'in_refund'">Vendor Credit Note</span>
|
|
<span t-elif="o.move_type == 'in_invoice'">Vendor Bill</span>
|
|
<span t-if="o.name != '/'" t-field="o.name"/>
|
|
</h2>
|
|
</xpath>
|
|
|
|
</template>
|
|
|
|
</odoo>
|