在odoo中的html类型字段中使用sanitize属性有什么用?

时间:2017-07-21 07:46:31

标签: openerp odoo-10 language-translation

在html类型的字段中,有一个属性可用,我们可以在其中传递 True / False

body_html = fields.Html('Body', translate=True, sanitize=False, help="Rich-text/HTML version of the message (placeholders may be used here)")

body_html = fields.Html('Body', translate=True, sanitize=True, help="Rich-text/HTML version of the message (placeholders may be used here)")

如果我们设置为True / False,那么我们会得到相同的结果。

如果我们在此字段中设置True / False有什么区别?

1 个答案:

答案 0 :(得分:3)

它只是告诉Odoo是否要清除HTML代码,比如删除脚本,标签/节点等。有关更多信息,请查看the code