[FIX] pos_*: properly check country from company
pos_*: l10n_ae_pos,l10n_co_pos,l10n_fr_pos_cert In many pos l10n addons, we assume that country is present in the company, and this is a wrong assumption. Thanks to the runbot error that we are able to detect these mistakes in the code. In this commit, we fix the issue by checking the presence of country first before actually accession the country code. Runbot Error: 20917 closes odoo/odoo#126117 X-original-commit: 172a5bc8628f8b774d9738c05c2eb7b0ef4db5ae Related: odoo/enterprise#43019 Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<t t-name="l10n_ae_pos.OrderReceiptVAT" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
|
||||
<xpath expr="//div[@id='post_receipt_taxes_container']" position="replace">
|
||||
<div id='post_receipt_taxes_container'>
|
||||
<t t-if="pos.company.country.code == 'AE'">VAT</t>
|
||||
<t t-if="pos.company.country?.code == 'AE'">VAT</t>
|
||||
<t t-else="">Total Taxes</t>
|
||||
<span t-esc="env.utils.formatCurrency(receipt.total_tax)" class="pos-receipt-right-align"/>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { patch } from "@web/core/utils/patch";
|
||||
|
||||
patch(PosStore.prototype, "l10n_co_pos.PosStore", {
|
||||
is_colombian_country() {
|
||||
return this.company.country.code === "CO";
|
||||
return this.company.country?.code === "CO";
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ patch(PosStore.prototype, "l10n_fr_pos_cert.PosStore", {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return french_countries.includes(this.company.country.code);
|
||||
return french_countries.includes(this.company.country?.code);
|
||||
},
|
||||
disallowLineQuantityChange() {
|
||||
const result = this._super(...arguments);
|
||||
|
||||
Reference in New Issue
Block a user