Use get_id of ir.model.data
This commit is contained in:
+3
-8
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user