I want to use the invoice number that is generated when confirming an invoice, but I want to use it when confirming the invoice.
The problem is that at the moment of confirming the invoice, the field “invoice.name” is “/” or “draft”.
I use the _post() method and would like to know if there is a way to get the invoice number after it has been generated.
For example:
def _post(self, soft):
for invoice in self:
raise UserError(invoice.name)
return super(AccountMove, self)._post(soft)
In the usererror that will be raised when confirming, I want to get something like “INV/2024/00038” and not “draft”.