|
from odoo import fields, models, _
|
|
|
|
class RecurringDonationWizard(models.TransientModel):
|
|
_name = 'opendons.recurringdonation.wizard'
|
|
_description = 'recurring donation wizard'
|
|
|
|
stopped_reason=fields.Selection(string='Stop reason',selection=[('motif1', 'Motif 1'), ('motif2', 'Motif 2')])
|
|
donation_id=fields.Integer('donation id')
|
|
|
|
|
|
def stopRecurringDonation(self):
|
|
|
|
donation=self.env['donation.donation'].search([('id','=',self.donation_id)])
|
|
donation.recurring_template="stopped"
|
|
donation.stopped_reason=self.stopped_reason
|
|
donation.stopped_date=fields.Date.context_today(self)
|
|
|