[FIX] point_of_sale : printing expected shipping date on receipt
Steps to reproduce: 1- Install Point of sale module 2- Allow shipping later configuration 3- Create a POS order with a shipping date Current behavior before PR: The expected shipping date was not printed in the pos receipt. This was happening because it was getting called wrong in xml file where it was called 'props.shippingDate'. By checking the JS file we found that the props object structure as follows https://github.com/odoo/odoo/blob/17.0/addons/point_of_sale/static/src/app/screens/receipt_screen/receipt/order_receipt.js#L16:L19 Desired behavior after PR is merged: The expected shipping date is printed not if exists. As we it is now getting called correctly 'props.data.shippingDate' opw-3746053 closes odoo/odoo#155844 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
+2
-2
@@ -124,10 +124,10 @@
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<t t-if="props.shippingDate">
|
||||
<t t-if="props.data.shippingDate">
|
||||
<div class="pos-receipt-order-data">
|
||||
Expected delivery:
|
||||
<div><t t-esc="props.shippingDate" /></div>
|
||||
<div><t t-esc="props.data.shippingDate" /></div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
|
||||
@@ -275,21 +275,3 @@ registry.category("web_tour.tours").add("PaymentScreenTotalDueWithOverPayment",
|
||||
PaymentScreen.totalDueIs("1.95"),
|
||||
].flat(),
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add("InvoiceShipLaterAccessRight", {
|
||||
test: true,
|
||||
url: "/pos/ui",
|
||||
steps: () =>
|
||||
[
|
||||
ProductScreen.confirmOpeningPopup(),
|
||||
ProductScreen.clickHomeCategory(),
|
||||
ProductScreen.addOrderline("Whiteboard Pen", "1"),
|
||||
ProductScreen.clickPartnerButton(),
|
||||
ProductScreen.clickCustomer("Deco Addict"),
|
||||
ProductScreen.clickPayButton(),
|
||||
|
||||
PaymentScreen.clickPaymentMethod("Cash"),
|
||||
PaymentScreen.clickShipLaterButton(),
|
||||
PaymentScreen.clickValidate(),
|
||||
].flat(),
|
||||
});
|
||||
|
||||
@@ -18,11 +18,17 @@ registry.category("web_tour.tours").add("ReceiptScreenTour", {
|
||||
// press close button in receipt screen
|
||||
ProductScreen.addOrderline("Letter Tray", "10", "5"),
|
||||
ProductScreen.selectedOrderlineHas("Letter Tray", "10"),
|
||||
ProductScreen.clickPartnerButton(),
|
||||
ProductScreen.clickCustomer("Addison Olson"),
|
||||
ProductScreen.clickPayButton(),
|
||||
PaymentScreen.clickPaymentMethod("Bank"),
|
||||
PaymentScreen.validateButtonIsHighlighted(true),
|
||||
PaymentScreen.clickShipLaterButton(),
|
||||
PaymentScreen.shippingLaterHighlighted(),
|
||||
PaymentScreen.clickValidate(),
|
||||
ReceiptScreen.receiptIsThere(),
|
||||
//receipt had expected delivery printed
|
||||
ReceiptScreen.shippingDateExists(),
|
||||
// letter tray has 10% tax (search SRC)
|
||||
ReceiptScreen.totalAmountContains("55.0"),
|
||||
ReceiptScreen.clickNextOrder(),
|
||||
@@ -70,6 +76,7 @@ registry.category("web_tour.tours").add("ReceiptScreenTour", {
|
||||
PaymentScreen.clickPaymentMethod("Bank"),
|
||||
PaymentScreen.clickValidate(),
|
||||
Order.hasLine({ customerNote: "Test customer note" }),
|
||||
ReceiptScreen.clickNextOrder(),
|
||||
].flat(),
|
||||
});
|
||||
|
||||
|
||||
@@ -277,3 +277,13 @@ export function clickShipLaterButton() {
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export function shippingLaterHighlighted(){
|
||||
return [
|
||||
{
|
||||
content: 'Shipping later button is highlighted',
|
||||
trigger: '.button:contains("Ship Later").highlight',
|
||||
isCheck: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -98,4 +98,13 @@ export function trackingMethodIsLot() {
|
||||
run: () => {},
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export function shippingDateExists() {
|
||||
return [
|
||||
{
|
||||
content: 'Shipping date must be printed',
|
||||
trigger: '.pos-receipt-order-data:contains("Expected delivery:")'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -527,6 +527,7 @@ class TestUi(TestPointOfSaleHttpCommon):
|
||||
self.main_pos_config.write({
|
||||
'iface_tipproduct': True,
|
||||
'tip_product_id': self.tip.id,
|
||||
'ship_later': True
|
||||
})
|
||||
|
||||
# open a session, the /pos/ui controller will redirect to it
|
||||
|
||||
Reference in New Issue
Block a user