You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
819 B

  1. # -*- coding: utf-8 -*-
  2. from openerp import api, fields, models, _
  3. class SubscriptionRequest(models.Model):
  4. _inherit = 'subscription.request'
  5. payment_type = fields.Selection([('online', 'Online'),
  6. ('deferred', 'Deferred')], string='Payment Type')
  7. def send_capital_release_request(self, invoice):
  8. if self.payment_type == 'deferred':
  9. super(SubscriptionRequest, self).send_capital_release_request(invoice)
  10. return True
  11. class AccountInvoice(models.Model):
  12. _inherit = 'account.invoice'
  13. def post_process_confirm_paid(self, effective_date):
  14. if self.subscription_request.payment_type == 'deferred':
  15. self.set_cooperator_effective(effective_date)
  16. return True