In Odoo, I can open a record in form view by using a button to trigger an action on the data model:
@openerp.api.multi
def open_record_in_form_view(self):
return {
'type': 'ir.actions.act_window',
'res_model': 'model.name',
'views': ((False, 'form'), (False, 'tree')),
'res_id': RECORD_ID,
'domain': [('field', '=', 'value')],
}
The record opens correctly, except that the pager is disabled. The curious bit is that when I toggle from form view to list view, the correct set of records is shown (as per the specified domain), and then when I toggle back from list view to form view, the pager is enabled, and I can page through the records in the domain.
How do I enable the pager when first opening form view? I want to page through a set of records a in domain, but in form view, not in list view view.
view_mode
andview_type
, and I also tried settingviews
. As I understand it, Odoo initializes the value for theviews
settings from theview_mode
andview_type
settings. You can read a (very) little bit about that here: odoo.com/documentation/8.0/reference/actions.html Still at a loss for how to do this. – Monica For CEO