Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2398 มุมมอง

Been trying to get the content of an html field printed but it always has

tags included.

have tried several options including t-out, field etc

props.partner.comment" t-options='{"widget": "html"}'/>


Can anyone help?

อวตาร
ละทิ้ง
ผู้เขียน

Forgot to mention this is for Odoo v 16

คำตอบที่ดีที่สุด

Hi,

Try like below

set const { markup } = owl;

set props.partner.comment = markup(props.partner.comment)

now using t-out will print content without the tags

Regards

อวตาร
ละทิ้ง
ผู้เขียน

Where or how do I add this?

ผู้เขียน

I added it to my js files as follows but I'm not sure if I did it correctly as I'm still seeing the tags

/** @odoo-module */
import { PosGlobalState} from 'point_of_sale.models';
import Registries from 'point_of_sale.Registries';
const { markup } = owl;
const ACCPosGlobalState = (PosGlobalState) => class ACCPosGlobalState extends PosGlobalState {
async _processData(loadedData) {

await super._processData(...arguments);

this.x_studio_acc_num = loadedData['res.partner'];
console.log(this.x_studio_acc_num)

this.comment = loadedData['res.partner'];
this.comment = markup(this.comment);
console.log(this.comment)

}
}
Registries.Model.extend(PosGlobalState, ACCPosGlobalState);

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มี.ค. 17
6262
3
พ.ค. 25
1701
1
เม.ย. 25
1272
one2one relational field แก้ไขแล้ว
3
ก.ย. 24
14157
1
ก.ย. 24
4390