diff --git a/invoice.py b/invoice.py index 32d09ac0d8..6ec1c35108 100644 --- a/invoice.py +++ b/invoice.py @@ -2586,14 +2586,9 @@ class CreditInvoice(Wizard): invoice_ids = invoice_obj.credit(cursor, user, data['ids'], refund=refund, context=context) - model_data_ids = model_data_obj.search(cursor, user, [ - ('fs_id', '=', 'act_invoice_form'), - ('module', '=', 'account_invoice'), - ('inherit', '=', False), - ], limit=1, context=context) - model_data = model_data_obj.browse(cursor, user, model_data_ids[0], - context=context) - res = act_window_obj.read(cursor, user, model_data.db_id, context=context) + act_window_id = model_data_obj.get_id(cursor, user, 'account_invoice', + 'act_invoice_form', context=context) + res = act_window_obj.read(cursor, user, act_window_id, context=context) res['res_id'] = invoice_ids if len(invoice_ids) == 1: res['views'].reverse()