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;
},
});
| 関連投稿 | 返信 | ビュー | 活動 | |
|---|---|---|---|---|
|
1
12月 25
|
1890 | |||
|
1
12月 25
|
1308 | |||
|
1
4月 26
|
622 | |||
|
4
2月 26
|
5479 | |||
|
1
7月 25
|
2654 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.