[FIX] base/ir_ui_view: Raise ValidationError when creating views without arch/type

Closes #16973

Steps to reproduce:

1) Go to Settings -> Technical -> User Interface -> Views
2) Create a new view and give only name, leave fields View Type and arch_base empty.
3) Exception occures

Current behaviour:
- The user gets an exception with a full stacktrace.
Expected behaviour:
- The user should get a warning
This commit is contained in:
George Daramouskas
2017-06-22 16:27:20 +02:00
committed by Yannick Tivisse
parent d44b7e9b1b
commit 063ee0751b
+2
View File
@@ -341,6 +341,8 @@ actual arch.
else:
try:
if not values.get('arch') and not values.get('arch_base'):
raise ValidationError(_('Missing view architecture.'))
values['type'] = etree.fromstring(values.get('arch') or values.get('arch_base')).tag
except LxmlError:
# don't raise here, the constraint that runs `self._check_xml` will