<commit_before># -*- coding: utf-8 -*-
from openerp import api, fields, models, _

class SubscriptionRequest(models.Model):
    _inherit = 'subscription.request'

    payment_type = fields.Selection([('online', 'Online'),
                                     ('deferred', 'Deferred')], string='Payment Type')
    
    def send_capital_release_request(self, invoice):
        if self.payment_type == 'deferred':
            super(SubscriptionRequest, self).send_capital_release_request(invoice)
        return True
    
class AccountInvoice(models.Model):
    _inherit = 'account.invoice'
        
    def post_process_confirm_paid(self, effective_date):
        if self.subscription_request.payment_type == 'deferred':
            self.set_cooperator_effective(effective_date) 
               
        return True<commit_msg>[FIX] adding default value "deferred" for payment type to avoid problem when creating subscription request from backend.<commit_after># -*- coding: utf-8 -*-
from openerp import api, fields, models, _

class SubscriptionRequest(models.Model):
    _inherit = 'subscription.request'

    payment_type = fields.Selection([('online', 'Online'),
                                     ('deferred', 'Deferred')], string='Payment Type', default="deferred")
    
    def send_capital_release_request(self, invoice):
        if self.payment_type == 'deferred':
            super(SubscriptionRequest, self).send_capital_release_request(invoice)
        return True
    
class AccountInvoice(models.Model):
    _inherit = 'account.invoice'
        
    def post_process_confirm_paid(self, effective_date):
        if self.subscription_request.payment_type == 'deferred':
            self.set_cooperator_effective(effective_date) 
               
        return True
{'fraction_non_alphanumeric': 0.09950522264980759, 'fraction_numerical': 0.0010995052226498076, 'mean_word_length': 2.691683569979716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5096409', 'n_tokens_mistral': 499, 'n_tokens_neox': 469, 'n_words': 102}