from odoo import models, fields, api
|
|
from odoo.exceptions import UserError, ValidationError
|
|
from psycopg2 import sql, DatabaseError
|
|
|
|
from werkzeug import utils
|
|
import base64
|
|
|
|
|
|
|
|
|
|
class DonationDonation(models.Model):
|
|
_inherit = 'donation.donation'
|
|
|
|
operation_id = fields.Many2one(
|
|
'opendons.operation',
|
|
string='Operation',
|
|
track_visibility='onchange',
|
|
ondelete='restrict'
|
|
|
|
)
|
|
segment_id = fields.Many2one(
|
|
'opendons.segment',
|
|
string='Segment',
|
|
track_visibility='onchange',
|
|
ondelete='restrict'
|
|
|
|
)
|
|
#pour les prélèvements automatiques
|
|
rum_direct_debit = fields.Char(
|
|
'RUM'
|
|
|
|
|
|
)
|
|
iban_direct_debit = fields.Char(
|
|
'iban'
|
|
)
|
|
bic_direct_debit = fields.Char(
|
|
'bic'
|
|
)
|
|
start_date_direct_debit = fields.Date(
|
|
string='Start Date',
|
|
index=True,
|
|
track_visibility='onchange'
|
|
)
|
|
end_date_direct_debit = fields.Date(
|
|
string='End Date',
|
|
index=True,
|
|
track_visibility='onchange'
|
|
)
|
|
frequency_direct_debit =fields.Selection(
|
|
[('monthly','Monthly'), ('bimonthly','Bimonthly'),('quarterly','Quarterly'),('half-yearly','Half-yearly'),('annually','Annually')],
|
|
default='monthly'
|
|
)
|
|
|
|
sepa_status_direct_debit=fields.Selection(
|
|
[('done','Done'),('rejected','Rejected')]
|
|
)
|
|
rejected_date_direct_debit = fields.Date(
|
|
string='rejected date',
|
|
index=True,
|
|
track_visibility='onchange'
|
|
)
|
|
|
|
|
|
# payment_batch_id = fields.Many2one(
|
|
# 'opendons_payment_batch',
|
|
# string='Payment Batch',
|
|
# ondelete='set null'
|
|
# )
|
|
|
|
# def _compute_rum(self):
|
|
# for rec in self:
|
|
# rec.rum_direct_debit=''
|
|
#if rec.recurring_template: rec.rum_direct_debit='GHGHH65767688899976'
|
|
#rec.rum_direct_debit='GHGHH65767688899976'
|
|
|