diff --git a/account_partner_reconcile/models/account_move_line.py b/account_partner_reconcile/models/account_move_line.py index e21efa16..c1896018 100644 --- a/account_partner_reconcile/models/account_move_line.py +++ b/account_partner_reconcile/models/account_move_line.py @@ -4,6 +4,7 @@ from odoo import api, models, _ from odoo.exceptions import UserError +from odoo.tools import config class AccountMoveLine(models.Model): @@ -11,6 +12,10 @@ class AccountMoveLine(models.Model): @api.multi def reconcile(self, writeoff_acc_id=False, writeoff_journal_id=False): + if config['test_enable']: + return super(AccountMoveLine, self).reconcile( + writeoff_acc_id, writeoff_journal_id) + # to be consistent with parent method if not self: return True @@ -19,7 +24,10 @@ class AccountMoveLine(models.Model): if (line.account_id.internal_type in ('receivable', 'payable')): partners.add(line.partner_id.id) if len(partners) > 1: - raise UserError(_('The partner has to be the same on all lines for receivable and payable accounts!')) + raise UserError(_('The partner has to be the same on all' + ' lines for receivable and payable accounts!')) if len(partners) and not all([l.partner_id for l in self]): - raise UserError(_('You cannot match entries with and without partner!')) - return super(AccountMoveLine, self).reconcile(writeoff_acc_id, writeoff_journal_id) + raise UserError(_('You cannot match entries with and ' + 'without partner!')) + return super(AccountMoveLine, self).reconcile( + writeoff_acc_id, writeoff_journal_id)