Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][backport] account: Allow skipping bank account creation on reconciliation #1240

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions addons/account/models/account_bank_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from odoo.osv import expression
from odoo.tools import float_is_zero
from odoo.tools import float_compare, float_round, float_repr
from odoo.tools.misc import formatLang, format_date
from odoo.tools.misc import formatLang, format_date, str2bool
from odoo.exceptions import UserError, ValidationError

import time
Expand Down Expand Up @@ -1310,7 +1310,9 @@ def reconcile(self, lines_vals_list, to_check=False):
def _find_or_create_bank_account(self):
bank_account = self.env['res.partner.bank'].search(
[('company_id', '=', self.company_id.id), ('acc_number', '=', self.account_number)])
if not bank_account:
if not bank_account and not str2bool(
self.env['ir.config_parameter'].sudo().get_param("account.skip_create_bank_account_on_reconcile")
):
bank_account = self.env['res.partner.bank'].create({
'acc_number': self.account_number,
'partner_id': self.partner_id.id,
Expand Down