<commit_before>##############################################################################
#
#    Copyright (C) 2020 Compassion CH (http://www.compassion.ch)
#    @author: <NAME> <<EMAIL>>
#
#    The licence is in the file __manifest__.py
#
##############################################################################
from odoo import models, fields


class MatchPartnerForm(models.AbstractModel):
    _inherit = "cms.form.match.partner"

    # Restrict allowed titles
    partner_title = fields.Many2one(domain=lambda s: s.public_title_domain())

    def public_title_domain(self):
        titles = (
            self.env.ref("base.res_partner_title_mister") +
            self.env.ref("base.res_partner_title_madam") +
            self.env.ref("partner_compassion.res_partner_title_family") +
            self.env.ref("partner_compassion.res_partner_title_mister_miss") +
            self.env.ref("partner_compassion.res_partner_title_ladies") +
            self.env.ref("partner_compassion.res_partner_title_men")
        )<commit_msg>CO-3336 removed some honorific titles from crowdfunding forms<commit_after>##############################################################################
#
#    Copyright (C) 2020 Compassion CH (http://www.compassion.ch)
#    @author: <NAME> <<EMAIL>>
#
#    The licence is in the file __manifest__.py
#
##############################################################################
from odoo import models, fields


class MatchPartnerForm(models.AbstractModel):
    _inherit = "cms.form.match.partner"

    # Restrict allowed titles
    partner_title = fields.Many2one(domain=lambda s: s.public_title_domain())

    def public_title_domain(self):
        titles = (
            self.env.ref("base.res_partner_title_mister") +
            self.env.ref("base.res_partner_title_madam") +
            self.env.ref("partner_compassion.res_partner_title_family")
        )
{'fraction_non_alphanumeric': 0.2570680628272251, 'fraction_numerical': 0.007329842931937173, 'mean_word_length': 4.192934782608695, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5208634', 'n_tokens_mistral': 573, 'n_tokens_neox': 541, 'n_words': 88}