跳至内容
菜单
此问题已终结
1 回复
2275 查看

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);

相关帖文 回复 查看 活动
2
3月 17
6053
3
5月 25
1345
1
4月 25
1049
3
9月 24
13781
1
9月 24
4162