def test_partner_onchange(self):
        customer_invoice = self.move_model.create(
            {"partner_id": self.customer.id, "move_type": "out_invoice"}
        )
        self.assertEqual(customer_invoice.payment_mode_id, self.customer_payment_mode)

        self.assertEqual(self.supplier_invoice.partner_bank_id, self.supplier_bank)
        vals = {"partner_id": self.customer.id, "move_type": "out_refund"}
        invoice = self.move_model.new(vals)
        self.assertEqual(invoice.payment_mode_id, self.supplier_payment_mode)
        vals = {"partner_id": self.supplier.id, "move_type": "in_refund"}
        invoice = self.move_model.new(vals)
        self.assertEqual(invoice.payment_mode_id, self.customer_payment_mode)
        vals = {"partner_id": False, "move_type": "out_invoice"}
        invoice = self.move_model.new(vals)
        self.assertFalse(invoice.payment_mode_id)
        vals = {"partner_id": False, "move_type": "out_refund"}
        invoice = self.move_model.new(vals)
        self.assertFalse(invoice.partner_bank_id)
        vals = {"partner_id": False, "move_type": "in_invoice"}
        invoice = self.move_model.new(vals)
        self.assertFalse(invoice.partner_bank_id)
        vals = {"partner_id": False, "move_type": "in_refund"}
        invoice = self.move_model.new(vals)
        self.assertFalse(invoice.partner_bank_id)