2013-08-21 09:24:37 |
Alexandre Fayolle - camptocamp |
description |
In most places where a xml id is used to refer to an object defined in the same module, it is possible to use a shortcut and to refer to the object as "object_id" rather than "module.object_id".
However, this does not work when specifying a view in the context attribute of a field element typically in a one2many field, as mentionned in https://doc.openerp.com/trunk/server/03_module_dev_03/#using-the-context which is quite confusing.
I am not sure that this can be fixed, because the evaluation of the context is done at runtime rather than import time, and the module information may not be available then. But the documentation should mention this and emphasize it, because it is a real tricky point.
Side note: this non feature is used in the stock module (which I unfortunately had consulted to check the validity of my view...) |
In most places where a xml id is used to refer to an object defined in the same module, it is possible to use a shortcut and to refer to the object as "object_id" rather than "module.object_id".
However, this does not work when specifying a view in the context attribute of a field element typically in a one2many field, as mentionned in https://doc.openerp.com/trunk/server/03_module_dev_03/#using-the-context which is quite confusing.
I am not sure that this can be fixed, because the evaluation of the context is done at runtime rather than import time, and the module information may not be available then. But the documentation should mention this and emphasize it, because it is a real tricky point.
Side note: this non feature is used in the stock module (which I unfortunately had consulted to check the validity of my view...). Reported as lp:1214801 |
|