return result
how can i solve this issue
return result
how can i solve this issue
Hello,
You can use this.config directly in PosOrder
const rateLimit = this.config?.rate_limit;
Hope this helps
Thanks
Please refer to the below forum post, where this issue is already explained in detail:
https://www.odoo.com/forum/help-1/how-to-add-a-new-field-to-odoo-pos-receipt-228592
Additionally, the main issue in your case is how the POS configuration is accessed in JavaScript.
In newer POS versions (Odoo 17 / 18 / 19), the POS configuration is not available under:
this.env.services.pos.config
Therefore, rate_limit is always coming as undefined.
The POS configuration is stored on:
this.pos.config
import { PosOrder } from "@point_of_sale/app/models/pos_order";
import { patch } from "@web/core/utils/patch";
patch(PosOrder.prototype, {
export_for_printing() {
const result = super.export_for_printing(...arguments);
const rateLimit = this.pos.config.rate_limit;
console.log("amount rate", rateLimit);
if (rateLimit && this.amount_total) {
result.rate_limit = this.amount_total * rateLimit;
}
return result;
},
});
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 | |
|---|---|---|---|---|
|
1
thg 12 25
|
1888 | |||
|
1
thg 12 25
|
1300 | |||
|
1
thg 4 26
|
621 | |||
|
4
thg 2 26
|
5478 | |||
|
1
thg 7 25
|
2652 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.