From f33e9ff4e54d8b6f21800ecb0e7ce2a6d45cda9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 2 Sep 2018 10:40:32 +0200 Subject: [PATCH] Use invoice payment method in scenario issue7450 --- tests/scenario_purchase.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/scenario_purchase.rst b/tests/scenario_purchase.rst index 598702f07c..96637e425f 100644 --- a/tests/scenario_purchase.rst +++ b/tests/scenario_purchase.rst @@ -42,10 +42,15 @@ Create chart of accounts:: >>> cash = accounts['cash'] >>> Journal = Model.get('account.journal') + >>> PaymentMethod = Model.get('account.invoice.payment.method') >>> cash_journal, = Journal.find([('type', '=', 'cash')]) - >>> cash_journal.credit_account = cash - >>> cash_journal.debit_account = cash >>> cash_journal.save() + >>> payment_method = PaymentMethod() + >>> payment_method.name = 'Cash' + >>> payment_method.journal = cash_journal + >>> payment_method.credit_account = cash + >>> payment_method.debit_account = cash + >>> payment_method.save() Create tax:: @@ -498,7 +503,7 @@ Pay the service invoice:: >>> service_invoice.invoice_date = today >>> service_invoice.click('post') >>> pay = Wizard('account.invoice.pay', [service_invoice]) - >>> pay.form.journal = cash_journal + >>> pay.form.payment_method = payment_method >>> pay.form.amount = service_invoice.total_amount >>> pay.execute('choice') >>> service_invoice.reload()