From aa47a4c20430be24682935767575c000d4cb1f88 Mon Sep 17 00:00:00 2001 From: Tobias Zehntner Date: Fri, 20 Feb 2026 14:10:23 +0100 Subject: [PATCH] [18.0][IMP] contract: manual invoice wizard hook --- contract/wizards/contract_manually_create_invoice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contract/wizards/contract_manually_create_invoice.py b/contract/wizards/contract_manually_create_invoice.py index 199efefa56..24fb7cceb5 100644 --- a/contract/wizards/contract_manually_create_invoice.py +++ b/contract/wizards/contract_manually_create_invoice.py @@ -54,8 +54,7 @@ def action_show_contract_to_invoice(self): "context": self.env.context, } - def create_invoice(self): - self.ensure_one() + def _create_invoices(self): invoices = self.env["account.move"] for contract in self.contract_to_invoice_ids: try: @@ -75,7 +74,11 @@ def create_invoice(self): ue=repr(oe), ) ) from oe + return invoices + def create_invoice(self): + self.ensure_one() + invoices = self._create_invoices() return { "type": "ir.actions.act_window", "name": self.env._("Invoices"),