The invoice status was badly computed since the loyalty refactor due to the use of the wrong value when comparing to the previous state. (to_invoice instead of to invoice) TaskId-2936708 closes odoo/odoo#97002 X-original-commit: e88dcd26eebf0e527929a0c48e259895822cf23e Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>