Skip to content

Commit 1e7c2ca

Browse files
committed
[I18N] point_of_sale: make receipt header fully translated
Because 'Tax ID' was within the `t-esc` the term was never translated. This goes against some country's compliance requirements for receipts, so we make it translatable now. We also make the full line translatable together since sometimes there are spacing + ordering differences between languages closes odoo#195103 X-original-commit: 61264be Signed-off-by: Louis Wicket (wil) <wil@odoo.com> Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
1 parent c352d86 commit 1e7c2ca

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

addons/point_of_sale/i18n/point_of_sale.pot

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ msgstr ""
8383
msgid "%(refunded_order)s REFUND"
8484
msgstr ""
8585

86+
#. module: point_of_sale
87+
#. odoo-javascript
88+
#: code:addons/point_of_sale/static/src/app/screens/receipt_screen/receipt/receipt_header/receipt_header.js:0
89+
msgid "%(vatLabel)s: %(vatId)s"
90+
msgstr ""
91+
8692
#. module: point_of_sale
8793
#. odoo-javascript
8894
#: code:addons/point_of_sale/static/src/app/screens/partner_list/partner_list.js:0
@@ -7150,6 +7156,12 @@ msgstr ""
71507156
msgid "Tax Group"
71517157
msgstr ""
71527158

7159+
#. module: point_of_sale
7160+
#. odoo-javascript
7161+
#: code:addons/point_of_sale/static/src/app/screens/receipt_screen/receipt/receipt_header/receipt_header.js:0
7162+
msgid "Tax ID: %(vatId)s"
7163+
msgstr ""
7164+
71537165
#. module: point_of_sale
71547166
#: model:ir.model.fields,field_description:point_of_sale.field_pos_order_line__price_subtotal_incl
71557167
msgid "Tax Incl."

addons/point_of_sale/static/src/app/screens/receipt_screen/receipt/receipt_header/receipt_header.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { _t } from "@web/core/l10n/translation";
12
import { Component } from "@odoo/owl";
23

34
export class ReceiptHeader extends Component {
@@ -13,4 +14,14 @@ export class ReceiptHeader extends Component {
1314
},
1415
},
1516
};
17+
18+
get vatText() {
19+
if (this.props.data.company.country_id?.vat_label) {
20+
return _t("%(vatLabel)s: %(vatId)s", {
21+
vatLabel: this.props.data.company.country_id.vat_label,
22+
vatId: this.props.data.company.vat,
23+
});
24+
}
25+
return _t("Tax ID: %(vatId)s", { vatId: this.props.data.company.vat });
26+
}
1627
}

addons/point_of_sale/static/src/app/screens/receipt_screen/receipt/receipt_header/receipt_header.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div>Tel:<t t-esc="props.data.company.phone" /></div>
1313
</t>
1414
<t t-if="props.data.company.vat">
15-
<div><t t-esc="props.data.company.country_id?.vat_label || 'Tax ID'"/>: <t t-esc="props.data.company.vat" /></div>
15+
<div t-esc="vatText"/>
1616
</t>
1717
<div t-if="props.data.company.email" t-esc="props.data.company.email" />
1818
<div t-if="props.data.company.website" t-esc="props.data.company.website" />

0 commit comments

Comments
 (0)