Skip to content

Commit

Permalink
[FIX] account,l10n_{au,in,gcc_invoice}: distinguish credit note titles
Browse files Browse the repository at this point in the history
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 #106692

Related: odoo/enterprise#34464
Signed-off-by: John Laterre (jol) <jol@odoo.com>
  • Loading branch information
dylankiss committed Nov 29, 2022
1 parent 228c640 commit 3f38d90
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
12 changes: 7 additions & 5 deletions addons/account/views/report_invoice.xml
Expand Up @@ -52,11 +52,13 @@
<div class="page">
<h2>
<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>
<span t-if="o.move_type == 'out_refund'">Credit Note</span>
<span t-if="o.move_type == 'in_refund'">Vendor Credit Note</span>
<span t-if="o.move_type == 'in_invoice'">Vendor Bill</span>
<span t-elif="o.move_type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
<span t-elif="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</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>

Expand Down
4 changes: 3 additions & 1 deletion addons/l10n_au/views/report_invoice.xml
Expand Up @@ -6,7 +6,9 @@
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">Tax Invoice</span>
<span t-elif="o.move_type == 'out_invoice' and o.state == 'draft'">Draft Tax Invoice</span>
<span t-elif="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled Tax Invoice</span>
<span t-elif="o.move_type == 'out_refund'">Tax Credit Note</span>
<span t-elif="o.move_type == 'out_refund' and o.state == 'posted'">Tax Credit Note</span>
<span t-elif="o.move_type == 'out_refund' and o.state == 'draft'">Draft Tax Credit Note</span>
<span t-elif="o.move_type == 'out_refund' and o.state == 'cancel'">Cancelled Tax Credit Note</span>
<span t-elif="o.move_type == 'in_refund'">Tax Vendor Credit Note</span>
<span t-elif="o.move_type == 'in_invoice'">Tax Vendor Bill</span>
<span t-if="o.name != '/'" t-field="o.name"/>
Expand Down
32 changes: 22 additions & 10 deletions addons/l10n_gcc_invoice/views/report_invoice.xml
Expand Up @@ -36,19 +36,25 @@
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">
Tax Invoice
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">
<span t-elif="o.move_type == 'out_invoice' and o.state == 'draft'">
Draft Invoice
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">
<span t-elif="o.move_type == 'out_invoice' and o.state == 'cancel'">
Cancelled Invoice
</span>
<span t-if="o.move_type == 'out_refund'">
<span t-elif="o.move_type == 'out_refund' and o.state == 'posted'">
Credit Note
</span>
<span t-if="o.move_type == 'in_refund'">
<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-if="o.move_type == 'in_invoice'">
<span t-elif="o.move_type == 'in_invoice'">
Vendor Bill
</span>
</div>
Expand All @@ -59,19 +65,25 @@
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">
فاتورة ضريبية
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">
<span t-elif="o.move_type == 'out_invoice' and o.state == 'draft'">
مسودة فاتورة
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">
<span t-elif="o.move_type == 'out_invoice' and o.state == 'cancel'">
فاتورة ملغاة
</span>
<span t-if="o.move_type == 'out_refund'">
<span t-elif="o.move_type == 'out_refund' and o.state == 'posted'">
إشعار خصم
</span>
<span t-if="o.move_type == 'in_refund'">
<span t-elif="o.move_type == 'out_refund' and o.state == 'draft'">
إشعار خصم المسودة
</span>
<span t-elif="o.move_type == 'out_refund' and o.state == 'cancel'">
إشعار خصم ملغاة
</span>
<span t-elif="o.move_type == 'in_refund'">
إشعار خصم المورد
</span>
<span t-if="o.move_type == 'in_invoice'">
<span t-elif="o.move_type == 'in_invoice'">
فاتورة المورد
</span>
</div>
Expand Down
14 changes: 8 additions & 6 deletions addons/l10n_in/views/report_invoice.xml
Expand Up @@ -42,12 +42,14 @@
<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-if="o.move_type == 'out_invoice' and o.state == 'draft'">Draft <span t-field="o.journal_id.name"/></span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled <span t-field="o.journal_id.name"/></span>
<span t-if="o.move_type == 'out_refund'">Credit Note</span>
<span t-if="o.move_type == 'in_refund'">Vendor Credit Note</span>
<span t-if="o.move_type == 'in_invoice'">Vendor Bill</span>
<span t-field="o.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>

Expand Down

0 comments on commit 3f38d90

Please sign in to comment.