<commit_before># -*- coding: utf-8 -*-

from odoo import api, fields, models
from odoo.addons.website.models.website import slug


class WebsiteResPartner(models.Model):
    _name = 'res.partner'
    _inherit = ['res.partner', 'website.seo.metadata', 'website.published.mixin']

    website_private = fields.Boolean(string='Private Profile', compute='_compute_private',
                                            inverse='_set_private', search='_search_private')
    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.Many2one(comodel_name=_name, compute='_compute_get_ids')

    @api.one
    def _compute_get_ids(self):
        self.self = self.id

    @api.multi
    def _compute_private(self):
        for partner in self:
            partner.website_private = not partner.website_published

    def _set_private(self):
        for partner in self:
            partner.website_published = not partner.website_private

    def _search_private(self, operator, value):
        return [('website_published', '=', not value)]

    @api.multi
    def _website_url(self, field_name, arg):
        res = super(WebsiteResPartner, self)._website_url(field_name, arg)
        for partner in self:
            res[partner.id] = "/partners/%s" % slug(partner)
        return res<commit_msg>[REM] website_partner: removing website_private unused<commit_after># -*- coding: utf-8 -*-

from odoo import api, fields, models
from odoo.addons.website.models.website import slug


class WebsiteResPartner(models.Model):
    _name = 'res.partner'
    _inherit = ['res.partner', 'website.seo.metadata', 'website.published.mixin']

    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.Many2one(comodel_name=_name, compute='_compute_get_ids')

    @api.one
    def _compute_get_ids(self):
        self.self = self.id

    @api.multi
    def _website_url(self, field_name, arg):
        res = super(WebsiteResPartner, self)._website_url(field_name, arg)
        for partner in self:
            res[partner.id] = "/partners/%s" % slug(partner)
        return res
{'fraction_non_alphanumeric': 0.10595482546201232, 'fraction_numerical': 0.0016427104722792608, 'mean_word_length': 3.389189189189189, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2357042', 'n_tokens_mistral': 746, 'n_tokens_neox': 705, 'n_words': 172}