<commit_before># -*- coding: utf-8 -*-
# © 2014 Compassion CH - <NAME> <<EMAIL>>
# © 2014 Serv. Tecnol. Avanzados - <NAME>
# © 2015 Akretion - <NAME> <<EMAIL>>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields, exceptions, api, _


class AccountBankingMandate(models.Model):
    """The banking mandate is attached to a bank account and represents an
    authorization that the bank account owner gives to a company for a
    specific operation (such as direct debit)
    """
    _name = 'account.banking.mandate'
    _description = "A generic banking mandate"
    _rec_name = 'unique_mandate_reference'
    _inherit = ['mail.thread']
    _order = 'signature_date desc'
    _track = {
        'state': {
            'account_banking_mandate.mandate_valid': (
                lambda self, cr, uid, obj, ctx=None: obj['state'] == 'valid'),
            'account_banking_mandate.mandate_expired': (
                lambda self, cr, uid, obj, ctx=None:
                obj['state'] == 'expired'),
            'account_banking_mandate.mandate_cancel': (
                lambda self, cr, uid, obj, ctx=None: obj['state'] == 'cancel'),
        },
    }

    def _get_states(self):
        return [('draft', 'Draft'),
                ('valid', 'Valid'),
                ('expired', 'Expired'),
                ('cancel', 'Cancelled')]

    format = fields.Selection(
        [('basic', _('Basic Mandate'))],
        default='basic',
        string='Mandate Format',
    )
    partner_bank_id = fields.Many2one(
        comodel_name='res.partner.bank', string='Bank Account',
        track_visibility='onchange')
    partner_id = fields.Many2one(<commit_msg>[IMP][8.0] account_banking_mandate: Make format field required<commit_after># -*- coding: utf-8 -*-
# © 2014 Compassion CH - <NAME> <<EMAIL>>
# © 2014 Serv. Tecnol. Avanzados - <NAME>
# © 2015 Akretion - <NAME> <<EMAIL>>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields, exceptions, api, _


class AccountBankingMandate(models.Model):
    """The banking mandate is attached to a bank account and represents an
    authorization that the bank account owner gives to a company for a
    specific operation (such as direct debit)
    """
    _name = 'account.banking.mandate'
    _description = "A generic banking mandate"
    _rec_name = 'unique_mandate_reference'
    _inherit = ['mail.thread']
    _order = 'signature_date desc'
    _track = {
        'state': {
            'account_banking_mandate.mandate_valid': (
                lambda self, cr, uid, obj, ctx=None: obj['state'] == 'valid'),
            'account_banking_mandate.mandate_expired': (
                lambda self, cr, uid, obj, ctx=None:
                obj['state'] == 'expired'),
            'account_banking_mandate.mandate_cancel': (
                lambda self, cr, uid, obj, ctx=None: obj['state'] == 'cancel'),
        },
    }

    def _get_states(self):
        return [('draft', 'Draft'),
                ('valid', 'Valid'),
                ('expired', 'Expired'),
                ('cancel', 'Cancelled')]

    format = fields.Selection(
        [('basic', _('Basic Mandate'))],
        default='basic',
        required=True,
        string='Mandate Format',
    )
    partner_bank_id = fields.Many2one(
        comodel_name='res.partner.bank', string='Bank Account',
        track_visibility='onchange')
    partner_id = fields.Many2one(
{'fraction_non_alphanumeric': 0.13981588032220943, 'fraction_numerical': 0.010356731875719217, 'mean_word_length': 2.584536082474227, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '6813104', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1048, 'n_words': 273}