When a new inheriting view is imported during a module
installation, it is validated thanks to the _constraints
on the ir.ui.view model. However the validation uses
a rather convoluted system for validating the whole
view tree at once (root view + all inherited changes)
while only taking into account the views that belong
to modules that are currently loaded.
This complicated system is necessary to be able to
operate on-the-fly at any point during the registry
loading/initialization.
Now because _constraints are checked during create()
this particular validation happens *before* the
external ID (ir.model.data entry) of that new view
can be created (it obviously needs to wait until
the view record is inserted). As a consequence the
view validation cannot determine the module to
which that new view belongs, and was erroneously
ignoring it.
Changing the view filtering to also include views
from unknown modules fixes this transient problem,
and also means that manually created inherited
views will be validated during module init too.
bzr revid: odo@openerp.com-20130703215704-x732bepiifvf4g3n
* Formally make model not required
* Remove idiotic default values on type and arch
* Make type not required (it's a function field!)
bzr revid: xmo@openerp.com-20130426145113-cf0t0xx24lk9mtgs
* view['model'] required for base_model_name handling, force its read
as with arch (nb: arch could actually be made optional, if it's not
being read can skip most of the inheritance complexity no?)
* if model=None in get_inheriting_views_arch, it generates domain to
SQL `model is NULL`, except model required on ir.ui.view so unspec'd
models are `''` (the empty string) not NULL => inherited views never
found.
Righter move might be to formally make model non-required on view.
bzr revid: xmo@openerp.com-20130426090237-u3rojvx4gow6uue1
Also only case which should result in the id not existing is the
initial record, if a view_id is explicitly provided. So the loop can
avoid it's, it's traversing through an m2o so if the m2o value is not
null the next record in the chain should always exist.
bzr revid: xmo@openerp.com-20130423135739-jve1fe2it8q4gkwh
> Note that this method is deprecated as of ElementTree 1.3 and lxml
> 2.0. It returns an iterator in lxml, which diverges from the
> original ElementTree behaviour. If you want an efficient iterator,
> use the element.iter() method instead. You should only use this
> method in new code if you require backwards compatibility with older
> versions of lxml or ElementTree.
bzr revid: xmo@openerp.com-20130422091958-413qo439qqgv296u
super() finds the MRO parent of the provided class to resume the
execution chain from there, so the class being defined should be
provided.
Here view called super(osv.osv, self).create so if osv.osv (Model) had
a create() defined (which luckily it does not) it would've been
skipped.
bzr revid: xmo@openerp.com-20130415105744-cfx47t01oc7loyes
- as the custom views are still in place when validating the new arch, they would
hide the new arch and prevent proper validation (if custom views are set for uid 1)
- conversely, if the RNG validation has changed, the old view customizations may not
pass the updated validation rules, and cause spurious validation errors
bzr revid: odo@openerp.com-20120924104026-z7bjzzq80ifxy1oc
This will allow improved validation of inherited
views, which is not possible when only the raw
arch is validated on its own - without context
many things cannot be verified.
Calling fields_view_get() also catches early all
mistakes that require dynamic validation, like
wrong XPath expressions (parent view contains
no match).
In order to have current addons pass the improved
validation the RNG had to be fixed to support
the new @modifiers attribute added by fields_view_get()
itself on many view elements, and a few missing
valid attributes, like @invisible on <filter>
and <group>. The latter had never been used
as part of the view architecture but appear
as a result of the handling of @groups
restrictions on view elements, and must
be allowed by the RNG schema.
bzr revid: odo@openerp.com-20120614144633-31c642s7q7f28o6b
As of 7.0, RNG validation is not possible for form views
that have a version attribute equal to "7.0", due to the
allowed usage of HTML syntax mixed with the regular OpenERP
view syntax. RNG validation is still enabled for regular
form views (@version missing or less than "7.0"), and for
all other views types.
Validation of 7.0 form views should be improved with the
addition of an assertion-based schema, still to be done.
The above is also complemented with an explicit call to fields_view_get()
during view installation, in order to immediately verify
that the updated view hierarchy does not cause any
issue when loaded along with its related views (i.e
parent and siblings, for inheriting views).
In addition to that, fields_view_get() will now only
consider loading views that belong to modules that have
already been loaded. This avoids a lot of validation errors
during a module update operation, which runs on top of
an existing database with all previous views visible,
even those whose module is not loaded yet.
bzr revid: odo@openerp.com-20120611122758-qcw9xdhupl24busq
This way search(limit=1) will give you the latest customization for
a given user. This can be used by client side to allow multiple
customizations with multi-level undo.
bzr revid: odo@openerp.com-20110601105209-vtgf73reh90uipct
- Some logging code moved from netsvc.py to loglevels.py
- Changed imports to use the new openerp module
- config and netsvc initialization calls move to openerp-server.py
- Moved openerp-server.py outside the old bin directory
- Some imports in tools moved inside the methods to break mutual-dependencies
bzr revid: vmt@openerp.com-20110207125723-ooee7d7ng5elmkso