Code review comment for lp:~ajite/web-addons/7.0-web-addons-add-0001

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Having model and id in separate fields allows you to do nifty stuff like
'my_mails': fields.one2many('mail.message', 'res_id', domain=['model', '=', 'my.model'])
and joins are a lot more efficient of course, which is why they used the split approach for mail.message.

You can of course wrap model and res_id in a function field which is a reference field, but then the UI to pick the correct model is unusable (remember all the trickery I had to suffer through for fetchmail_inbox).

With this, we can simply set the model in the context or in on_change (judging from the code, that should work too)

review: Approve (code review)

« Back to merge proposal