[IMP] rng validation: remove call to rng validation, replace it with calls to fields_view_get.
bzr revid: vmt@openerp.com-20120604160124-uz4q4aim6sl9wckm
This commit is contained in:
parent
deb9992ca8
commit
d2252dba05
|
@ -74,10 +74,26 @@ class view(osv.osv):
|
||||||
_order = "priority,name"
|
_order = "priority,name"
|
||||||
|
|
||||||
def _check_xml(self, cr, uid, ids, context=None):
|
def _check_xml(self, cr, uid, ids, context=None):
|
||||||
|
def root_view(record):
|
||||||
|
if not record.inherit_id:
|
||||||
|
return record
|
||||||
|
else:
|
||||||
|
parent = self.browse(cr, uid, record.inherit_id.id, context)
|
||||||
|
return root_view(parent)
|
||||||
|
def call_view(record):
|
||||||
|
try:
|
||||||
|
root = root_view(record)
|
||||||
|
self.pool.get(root.model).fields_view_get(cr, uid, view_id=root.id, view_type=root.type, context=context)
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
_logger.exception("Can't obtain view description for model: %s (view id: %s).", record.model, record.id)
|
||||||
|
return False
|
||||||
for view in self.browse(cr, uid, ids, context):
|
for view in self.browse(cr, uid, ids, context):
|
||||||
|
return call_view(view)
|
||||||
|
|
||||||
|
# TODO The following code should be executed (i.e. no early return above).
|
||||||
|
# TODO The view.rng file can be read only once!
|
||||||
eview = etree.fromstring(view.arch.encode('utf8'))
|
eview = etree.fromstring(view.arch.encode('utf8'))
|
||||||
if eview.get('layout') or eview.get('validate'):
|
|
||||||
continue
|
|
||||||
frng = tools.file_open(os.path.join('base','rng','view.rng'))
|
frng = tools.file_open(os.path.join('base','rng','view.rng'))
|
||||||
try:
|
try:
|
||||||
relaxng_doc = etree.parse(frng)
|
relaxng_doc = etree.parse(frng)
|
||||||
|
|
|
@ -38,6 +38,7 @@ class base_module_upgrade(osv.osv_memory):
|
||||||
if view_type != 'form':
|
if view_type != 'form':
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
context = {} if context is None else context
|
||||||
record_id = context and context.get('active_id', False) or False
|
record_id = context and context.get('active_id', False) or False
|
||||||
active_model = context.get('active_model')
|
active_model = context.get('active_model')
|
||||||
if (not record_id) or (not active_model):
|
if (not record_id) or (not active_model):
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
<group>
|
<group>
|
||||||
<field name="note" nolabel="1" colspan="4" width="500"/>
|
<field name="note" nolabel="1" colspan="4" width="500"/>
|
||||||
<group colspan="4" col="8">
|
<group colspan="4" col="8">
|
||||||
<field name="progress" widget="progressbar"/>
|
|
||||||
<label string="" colspan="4"/>
|
<label string="" colspan="4"/>
|
||||||
<group colspan="1" col="2">
|
<group colspan="1" col="2">
|
||||||
<button name="action_next" icon="gtk-go-forward"
|
<button name="action_next" icon="gtk-go-forward"
|
||||||
|
|
Loading…
Reference in New Issue