[FIX] website_forum: fixed (un)publish management on the profile. Partners are now...
[odoo/odoo.git] / addons / website_partner / models / res_partner.py
1 # -*- coding: utf-8 -*-
2
3 from openerp.osv import osv, fields
4
5
6 class WebsiteResPartner(osv.Model):
7     _name = 'res.partner'
8     _inherit = ['res.partner', 'website.seo.metadata']
9
10     def _get_ids(self, cr, uid, ids, flds, args, context=None):
11         return {i: i for i in ids}
12
13     _columns = {
14         'website_published': fields.boolean(
15             'Publish', help="Publish on the website", copy=False),
16         'website_description': fields.html(
17             'Website Partner Full Description'
18         ),
19         'website_short_description': fields.text(
20             'Website Partner Short Description'
21         ),
22         # hack to allow using plain browse record in qweb views
23         'self': fields.function(_get_ids, type='many2one', relation=_name),
24     }
25
26     _defaults = {
27         'website_published': True
28     }