Files
odoo_source/addons/account_check_printing/models/chart_template.py
T
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00

21 lines
810 B
Python

# -*- coding: utf-8 -*-
from odoo import api, models
class AccountChartTemplate(models.Model):
_inherit = 'account.chart.template'
def _create_bank_journals(self, company, acc_template_ref):
'''
When system automatically creates journals of bank and cash type when CoA is being installed
do not enable the `Check` payment method on bank journals of type `Cash`.
'''
bank_journals = super(AccountChartTemplate, self)._create_bank_journals(company, acc_template_ref)
payment_method_check = self.env.ref('account_check_printing.account_payment_method_check')
bank_journals.filtered(lambda journal: journal.type == 'cash').write({
'outbound_payment_method_ids': [(3, payment_method_check.id)]
})
return bank_journals