In OpenERP, an OSV object can return something that can open a new view or activate an action. For example, sale.order has a manual_invoice method that returns the following:
return { 'name': _('Customer Invoices'), 'view_type': 'form', 'view_mode': 'form', 'view_id': [res_id], 'res_model': 'account.invoice', 'context': "{'type':'out_invoice'}", 'type': 'ir.actions.act_window', 'nodestroy': True, 'target': 'current', 'res_id': inv_ids and inv_ids[0] or False, }
and opens the invoice form window in the same window.
I saw that 'view_id': [res_id], changed to 'views': [(id2, 'form')], , and the other parts are also changed, and it still works.
So I donβt understand how this mechanism works. What determines which values ββin the return dict should be included? How can I find out which of them are mandatory and which are not?
Many thanks!
source share