diff --git a/account_payment_partner/migrations/11.0.1.3.0/post-migrate.py b/account_payment_partner/migrations/11.0.1.3.0/post-migrate.py deleted file mode 100644 index e63be7140..000000000 --- a/account_payment_partner/migrations/11.0.1.3.0/post-migrate.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2018 Carlos Dauden - Tecnativa -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - - -def migrate(cr, version): - """Update database from previous versions, after updating module.""" - cr.execute( - "UPDATE account_payment_mode " - "SET show_bank_account_from_journal = true " - "WHERE bank_account_link = 'fixed'" - ) diff --git a/account_payment_partner/tests/test_account_payment_partner.py b/account_payment_partner/tests/test_account_payment_partner.py index 3bdb459a1..abd2349de 100644 --- a/account_payment_partner/tests/test_account_payment_partner.py +++ b/account_payment_partner/tests/test_account_payment_partner.py @@ -33,16 +33,10 @@ class TestAccountPaymentPartner(common.SavepointCase): else: raise ValidationError( _("No Chart of Account Template has been defined !")) - cls.wizard = cls.env['wizard.multi.charts.accounts'].create({ - 'company_id': cls.company_2.id, - 'chart_template_id': cls.chart.id, - 'sale_tax_id': False, - 'purchase_tax_id': False, - 'code_digits': 6, - 'currency_id': cls.env.ref('base.EUR').id, - 'transfer_account_id': cls.chart.transfer_account_id.id, - }) - cls.wizard.execute() + old_company = cls.env.user.company_id + cls.env.user.company_id = cls.company_2.id + cls.chart.try_loading_for_current_company() + cls.env.user.company_id = old_company.id # refs cls.manual_out = cls.env.ref( @@ -295,6 +289,7 @@ class TestAccountPaymentPartner(common.SavepointCase): def test_invoice_refund(self): invoice = self._create_invoice() + invoice.partner_bank_id = False invoice.action_invoice_open() # Lets create a refund invoice for invoice_1. # I refund the invoice Using Refund Button. @@ -362,21 +357,15 @@ class TestAccountPaymentPartner(common.SavepointCase): def test_print_report(self): self.supplier_invoice.partner_bank_id = self.supplier_bank.id report = self.env.ref('account.account_invoices') - res = str(report.render_qweb_html( - self.supplier_invoice.ids, report.report_name, - )[0]) + res = str(report.render_qweb_html(self.supplier_invoice.ids)[0]) self.assertIn(self.supplier_bank.acc_number, res) payment_mode = self.supplier_payment_mode payment_mode.show_bank_account_from_journal = True self.supplier_invoice.payment_mode_id = payment_mode.id self.supplier_invoice.partner_bank_id = False - res = str(report.render_qweb_html( - self.supplier_invoice.ids, report.report_name, - )[0]) + res = str(report.render_qweb_html(self.supplier_invoice.ids)[0]) self.assertIn(self.journal_c1.bank_acc_number, res) payment_mode.bank_account_link = 'variable' payment_mode.variable_journal_ids = [(6, 0, self.journal.ids)] - res = str(report.render_qweb_html( - self.supplier_invoice.ids, report.report_name, - )[0]) + res = str(report.render_qweb_html(self.supplier_invoice.ids)[0]) self.assertIn(self.journal_bank.acc_number, res)