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"),