<commit_before>##############################################################################
#
#    Copyright (C) 2016-2018 Compassion CH (http://www.compassion.ch)
#    Releasing children from poverty in Jesus' name
#    @author: <NAME> <<EMAIL>>
#
#    The licence is in the file __manifest__.py
#
##############################################################################
import logging
from datetime import date, timedelta
import uuid

from dateutil.relativedelta import relativedelta

from odoo import api, models, fields, _
from odoo.addons.auth_signup.models.res_partner import now

_logger = logging.getLogger(__name__)


class ResPartner(models.Model):
    """
    Add method to send all planned communication of sponsorships.
    """

    _name = "res.partner"
    _inherit = ["res.partner", "translatable.model"]

    tax_receipt_preference = fields.Selection(
        selection="_get_delivery_preference",
        compute="_compute_tax_receipt_preference",
        store=True,
    )
    letter_delivery_preference = fields.Selection(
        selection="_get_delivery_preference",
        default="auto_digital",
        required=True,
        help="Delivery preference for Child Letters",
    )
    no_physical_letter = fields.Boolean(
        compute="_compute_no_physical_letter",
        inverse="_inverse_no_physical_letter",
        help="Tells if all communication preferences are set to email only.")
    is_new_donor = fields.Boolean(compute="_compute_new_donor")
    last_completed_tax_receipt = fields.Integer(
        compute="_compute_last_completed_tax_receipt",
        help="Gives the year of the last tax receipt sent to the partner"
    )
    informal_salutation = fields.Char(compute="_compute_informal_salutation",
                                      help="Informal salutation used in French")

    onboarding_new_donor_start_date = fields.Date(help="Indicates when the first email of "
                                                       "the new donor onboarding process was sent.",
                                                  copy=False)
    onboarding_new_donor_hash = fields.Char()
<commit_msg>FIX Signup token fields access rights<commit_after>##############################################################################
#
#    Copyright (C) 2016-2018 Compassion CH (http://www.compassion.ch)
#    Releasing children from poverty in Jesus' name
#    @author: <NAME> <<EMAIL>>
#
#    The licence is in the file __manifest__.py
#
##############################################################################
import logging
from datetime import date, timedelta
import uuid

from dateutil.relativedelta import relativedelta

from odoo import api, models, fields, _
from odoo.addons.auth_signup.models.res_partner import now

_logger = logging.getLogger(__name__)


class ResPartner(models.Model):
    """
    Add method to send all planned communication of sponsorships.
    """

    _name = "res.partner"
    _inherit = ["res.partner", "translatable.model"]

    tax_receipt_preference = fields.Selection(
        selection="_get_delivery_preference",
        compute="_compute_tax_receipt_preference",
        store=True,
    )
    letter_delivery_preference = fields.Selection(
        selection="_get_delivery_preference",
        default="auto_digital",
        required=True,
        help="Delivery preference for Child Letters",
    )
    no_physical_letter = fields.Boolean(
        compute="_compute_no_physical_letter",
        inverse="_inverse_no_physical_letter",
        help="Tells if all communication preferences are set to email only.")
    is_new_donor = fields.Boolean(compute="_compute_new_donor")
    last_completed_tax_receipt = fields.Integer(
        compute="_compute_last_completed_tax_receipt",
        help="Gives the year of the last tax receipt sent to the partner"
    )
    informal_salutation = fields.Char(compute="_compute_informal_salutation",
                                      help="Informal salutation used in French")

    onboarding_new_donor_start_date = fields.Date(help="Indicates when the first email of "
                                                       "the new donor onboarding process was sent.",
                                                  copy=False)
    onboarding_new_donor_hash = fields.Char()
    # Extend access rights on signup fields to allow generating links in onboardings
    signup_token = fields.Char(groups="base.group_user")
    signup_type = fields.Char(groups="base.group_user")
    signup_expiration = fields.Datetime(groups="base.group_user")

{'fraction_non_alphanumeric': 0.14388646288209608, 'fraction_numerical': 0.0034934497816593887, 'mean_word_length': 3.2733208955223883, '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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '412764', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1175, 'n_words': 293}