Files
odoo_source/addons/website_partner/models/res_partner.py
T
Olivier Dony 13476c844d [FIX] fields.html, forum: opt-in stripping of @style attrs
For public-facing HTML content provided by the user,
`<style>` tags and `style` attributes should be stripped
automatically, as they can easily be abused to deface
pages for abusive users and spammers.
<style> tags were already stripped, the optional `strip_style`
for fields.html enables the automatic stripping of style
attributes.

This is opt-in because custom style attributes are still
desirable in trusted HTML fields.
2015-03-09 14:41:14 +01:00

30 lines
856 B
Python

# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class WebsiteResPartner(osv.Model):
_name = 'res.partner'
_inherit = ['res.partner', 'website.seo.metadata']
def _get_ids(self, cr, uid, ids, flds, args, context=None):
return {i: i for i in ids}
_columns = {
'website_published': fields.boolean(
'Publish', help="Publish on the website", copy=False),
'website_description': fields.html(
'Website Partner Full Description',
strip_style=True
),
'website_short_description': fields.text(
'Website Partner Short Description'
),
# hack to allow using plain browse record in qweb views
'self': fields.function(_get_ids, type='many2one', relation=_name),
}
_defaults = {
'website_published': True
}