From 1d51e7fe52ca3102e2088c0cfb62a7e1c6c6097a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Honor=C3=A9?= Date: Wed, 23 Oct 2019 09:44:54 +0200 Subject: [PATCH] Update after review --- shopinvader_invoice/tests/test_invoice_service.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shopinvader_invoice/tests/test_invoice_service.py b/shopinvader_invoice/tests/test_invoice_service.py index 09d0f68dc7..73031d21d1 100644 --- a/shopinvader_invoice/tests/test_invoice_service.py +++ b/shopinvader_invoice/tests/test_invoice_service.py @@ -104,7 +104,7 @@ def _make_payment(self, invoice, journal=False, amount=False): :return: bool """ ctx = {"active_model": invoice._name, "active_ids": invoice.ids} - wizard_obj = self.register_payments_obj.with_context(ctx) + wizard_obj = self.register_payments_obj.with_context(**ctx) register_payments = wizard_obj.create( { "payment_date": fields.Date.today(), @@ -112,10 +112,13 @@ def _make_payment(self, invoice, journal=False, amount=False): "payment_method_id": self.payment_method_manual_in.id, } ) + values = {} if journal: - register_payments.write({"journal_id": journal.id}) + values.update({"journal_id": journal.id}) if amount: - register_payments.write({"amount": amount}) + values.update({"amount": amount}) + if values: + register_payments.write(values) register_payments.create_payment() def test_get_invoice_logged(self):