odoo/openerp
Xavier Morel d50f785b4f [FIX] view requested by _view_ref with view_ref being undotted
Issue introduced in
revid:chm@openerp.com-20130828161130-641xsmbr8xm53xjx: context of a
fields_view_get can provide a *_view_ref name (e.g. tree_view_ref),
whose value is an xid for the view to use (can be used to specify a
view instead of providing a view_id, mostly for embedded views where
there is no way to provide a view_id).

The view_ref being an external id, it must be dotted. Historically,
undotted xids were silently ignored and the system just skipped to
getting the default view for the model (lowest priority view where
inherit_id is null).

In revid:odo@openerp.com-20130821122955-8c9z0mi8cu48rne3 this behavior
was altered to emit a warning when ignoring a malformed view_ref. When
this change was merged into trunk-website-al, the conditional
(view_ref and '.' in view_ref) was split without consideration for the
semantics change: a syntactically invalid view_ref would fall off the
first branch (view_ref) instead of taking the second one (not
view_ref), the code would not fetch the default view for the model and
would instead generate one (through _get_default_%(viewtype)s_view).

However, closer reading reveals the code was already broken in a
specific case of a syntactically valid but unknown xid (view_id
wouldn't get assigned in the first branch, but the code would not take
the second one, resulting yet again in a view generation even if the
database contains a valid view for the model and type).

Fixed by reintroducing explicit second check on view_id, instead of
merely conditional alternative.

bzr revid: xmo@openerp.com-20140123075742-603n2zthqhxee07y
2014-01-23 08:57:42 +01:00
..
addons [FIX] stupid fme 2014-01-22 16:30:22 +01:00
cli [REF] Use the contextlib.closing function instead of a couple of try/catch for 2014-01-09 10:32:58 +01:00
conf [MERGE] openerp.pooler is deprecated. 2013-03-27 17:40:45 +01:00
modules [MERGE] forward port of branch 7.0 up to revid 5224 chs@openerp.com-20140206105141-7e8bv8ordqqsswh7 2014-02-06 12:02:20 +01:00
osv [FIX] view requested by _view_ref with view_ref being undotted 2014-01-23 08:57:42 +01:00
report [MERGE] forward port of branch 7.0 up to revid 5224 chs@openerp.com-20140206105141-7e8bv8ordqqsswh7 2014-02-06 12:02:20 +01:00
service [MERGE] forward port of branch 7.0 up to revid 5224 chs@openerp.com-20140206105141-7e8bv8ordqqsswh7 2014-02-06 12:02:20 +01:00
tests [MERGE] Sync with trunk, solved conflicts. 2014-01-16 10:17:16 +01:00
tools [CLEAN] ir_qweb: simplified and cleaned QWebcontext implementation 2014-01-16 19:27:50 +01:00
workflow [IMP] py26 compatibility 2014-01-20 14:53:33 +01:00
PKG-INFO [REM] netrpc: KILL EVERYBODY 2013-02-21 13:18:25 +01:00
__init__.py restore the original gevent detection 2013-09-10 01:19:46 +02:00
exceptions.py [REF] code review 2013-02-15 15:35:03 +01:00
http.py [FIX] local_redirect() should forward code to redirect_with_hash() 2014-01-22 11:40:22 +01:00
import_xml.rng [IMP] Backport one feature from website: this feature allows to specify a file 2014-01-09 16:43:38 +01:00
loglevels.py [REF] logging: removed pseudo log-level TEST. 2013-03-26 16:58:44 +01:00
netsvc.py [FORWARD] Forward port of server 7.0 until revision 4988 2013-05-28 12:27:33 +02:00
pooler.py [REF] pooler: mark the functions as deprecated. 2013-03-27 15:16:53 +01:00
release.py [REL] saas-2 2013-09-23 12:44:53 +02:00
sql_db.py [MERGE] forward merge 7.0 until revision 4919. 2013-04-04 15:07:04 +02:00