[FIX] pos_restaurant,l10n_in_pos: fix receipt data

1. Install l10n_pos_in
2. Make an order
3. Observer traceback in receipt screen

Similar problem in restaurant ( in bill screen )

closes odoo/odoo#140123

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
vlst
2023-10-27 21:36:52 +00:00
parent 7422b96b2e
commit 3c1d74181a
4 changed files with 11 additions and 5 deletions
@@ -19,7 +19,7 @@
<t t-name="l10n_in_pos.OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
<xpath expr="//Orderline" position="inside">
<t t-if="line.l10n_in_hsn_code and pos.company.country and pos.company.country.code == 'IN'">
<t t-if="line.l10n_in_hsn_code and props.data.headerData.company.country?.code === 'IN'">
<div class="pos-receipt-left-padding">
<span>HSN Code: </span>
<t t-esc="line.l10n_in_hsn_code"/>
@@ -21,7 +21,7 @@
</div>
<div class="pos-receipt-container text-center">
<div class="d-inline-block m-3 p-3 border rounded bg-view text-start overflow-hidden">
<OrderReceipt data="pos.get_order().export_for_printing()" formatCurrency="env.utils.formatCurrency" />
<OrderReceipt data="{...pos.get_order().export_for_printing(), isBill: isBill}" formatCurrency="env.utils.formatCurrency" />
</div>
</div>
</div>
@@ -3,15 +3,15 @@
<t t-name="pos_restaurant.OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
<xpath expr="//div[hasclass('pos-receipt-order-data')]" position="inside">
<t t-if="isBill">
<t t-if="props.data.isBill">
<div>PRO FORMA</div>
</t>
</xpath>
<xpath expr="//div[hasclass('receipt-change')]" position="attributes">
<attribute name="t-if">!isBill</attribute>
<attribute name="t-if">!props.data.isBill</attribute>
</xpath>
<xpath expr="//div[hasclass('before-footer')]" position="after">
<t t-if="isBill and pos.config.set_tip_after_payment">
<t t-if="props.data.isBill and props.data.set_tip_after_payment">
<div class="tip-form py-3">
<div class="title text-center mt-3">For convenience, we are providing the following gratuity calculations:</div>
<div class="percentage-options percentage-options d-flex flex-nowrap mt-3">
@@ -47,6 +47,12 @@ patch(Order.prototype, {
defaultTableNeeded(options) {
return !this.tableId && !options.json && this.pos.table;
},
export_for_printing() {
return {
...super.export_for_printing(...arguments),
set_tip_after_payment: this.pos.config.set_tip_after_payment,
};
},
});
patch(Orderline.prototype, {