[MERGE] fix view_validate to match rng
bzr revid: al@openerp.com-20130624170243-o9qjfo2s4obvqaea
This commit is contained in:
@@ -40,11 +40,6 @@ def valid_att_in_label(arch):
|
||||
return not arch.xpath('//label[not ((@for) or (@string))]')
|
||||
|
||||
|
||||
def valid_att_in_form(arch):
|
||||
"""A `string` attribute must be on a `form` node."""
|
||||
return not arch.xpath('//form[not (@string)]')
|
||||
|
||||
|
||||
def valid_type_in_colspan(arch):
|
||||
"""A `colspan` attribute must be an `integer` type."""
|
||||
for attrib in arch.xpath('//*/@colspan'):
|
||||
@@ -67,8 +62,7 @@ def valid_type_in_col(arch):
|
||||
|
||||
def valid_view(arch):
|
||||
if arch.tag == 'form':
|
||||
for pred in [valid_page_in_book, valid_att_in_form, valid_type_in_colspan,\
|
||||
valid_type_in_col, valid_att_in_field, valid_att_in_label]:
|
||||
for pred in [valid_page_in_book, valid_type_in_colspan, valid_type_in_col, valid_att_in_field, valid_att_in_label]:
|
||||
if not pred(arch):
|
||||
_logger.error('Invalid XML: %s', pred.__doc__)
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user