[11.0][MIG] account_reconcile_restrict_partner_mismatch: migrate

This commit is contained in:
Iryna Vyshnevska
2019-07-18 16:10:59 +03:00
parent 447abc40cf
commit 496b12060b
7 changed files with 4 additions and 15 deletions

View File

@@ -1,4 +1,2 @@
# -*- coding: utf-8 -*-
from . import models
from . import report

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
@@ -6,7 +5,7 @@
'name': 'Reconcile restrict partner mismatch',
'summary': 'Restrict reconciliation on receivable '
'and payable accounts to the same partner',
'version': '10.0.1.0.0',
'version': '11.0.1.0.0',
'depends': ['account'],
'author': 'Camptocamp, Odoo Community Association (OCA)',
'website': 'http://www.github.com/OCA/account-reconcile',

View File

@@ -1,3 +1 @@
# -*- coding: utf-8 -*-
from . import account_move_line

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
@@ -14,8 +13,7 @@ class AccountMoveLine(models.Model):
def reconcile(self, writeoff_acc_id=False, writeoff_journal_id=False):
if (config['test_enable']
and not self.env.context.get('test_partner_mismatch')):
return super(AccountMoveLine, self).reconcile(
writeoff_acc_id, writeoff_journal_id)
return super().reconcile(writeoff_acc_id, writeoff_journal_id)
# to be consistent with parent method
if not self:
@@ -27,5 +25,5 @@ class AccountMoveLine(models.Model):
if len(partners) > 1:
raise UserError(_('The partner has to be the same on all'
' lines for receivable and payable accounts!'))
return super(AccountMoveLine, self).reconcile(
return super().reconcile(
writeoff_acc_id, writeoff_journal_id)

View File

@@ -1,3 +1 @@
# -*- coding: utf-8 -*-
from . import report_reconciled_lines

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
@@ -9,7 +8,7 @@ from odoo.exceptions import UserError
class TestReconciliation(AccountingTestCase):
def setUp(self):
super(TestReconciliation, self).setUp()
super().setUp()
self.env = self.env(context=dict(
self.env.context, tracking_disable=True,
test_partner_mismatch=True)