Comment 10 for bug 865308

Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

Ok, now I was able to investigate.

The problem with the 'date' field in the o2m was a bug I recently corrected, so it's not happening anymore.

About the active_id, it's normal it doesn't work in this case in the web client. active_id is supposed to be the id of the record in the preceding view. In the gtk client, there is always a preceding view. If you come from a menu, the preceding model is assumed to be ir.ui.menu and the active_id is the id of the menu.

The new web client doesn't do that because:
1 - It doesn't work the same way, the menu is not a view like any other else
2 - We never had any case in the OpenERP addons where it was useful to get the id of a menu.
3 - There was a lot of addons that were incorrectly coded and that assumed that active_id was the id of a record in the xxx model (replace xxx by any model except ir.ui.menu).

So we decided to not simulate that functionality in the new web client, since it's useless and tends to produce programming errors.

So, you can still use the active_id, but only when you come from a form/list/anything view, not from a menu. If you're not sure, you can test the active_id is defined by doing something like: {'neither_this' : context.get('active_id', False)} .