How do I display the order date on the receipts screen at the point of sales on Odoo 17, here is the pos_receipt_extend module
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi,
The provided code is used to customize the Point of Sale module's receipt header to include the order date.
JS:
/** @odoo-module */
import { patch } from "@web/core/utils/patch";
import { Order } from "@point_of_sale/app/store/models";
patch(Order.prototype, {
export_for_printing() {
const result = super.export_for_printing(...arguments);
result.headerData = {
...this.pos.getReceiptHeaderData(),
date_order: this.date_order,
}
return result;
},
})
The code overrides the export_for_printing method of the Order to include the date_order field in the receipt header data.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="CustomReceiptHeader.
t-inherit="point_of_sale.
<xpath expr="//div[hasclass('cashier'
<div class="pos-receipt-contact">
<t t-esc="this.props.data.date_
</div>
</xpath>
</t>
</templates>
Inherit the 'point_of_sale.ReceiptHeader' template and add date_order wherever you want using xpath.
The JS and XML files should be included in the manifest file
"assets": {
"point_of_sale._assets_pos": [
"path_to_js_file",
"path_to_xml_file"
]
}
Hope it helps
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 1 23
|
3103 | ||
|
1
thg 5 18
|
4533 | ||
|
2
thg 5 17
|
3472 | ||
|
4
thg 11 16
|
4681 | ||
|
3
thg 5 16
|
8221 |