[FIX] base: arch should be required

The attribute has been lost during a previous commit e6695c72d8.

This commit avoid that you can create an ir.ui.view without arch.

Before this commit, if you try to create an ir.ui.view with type but no
arch, the code will raise an exception in _check_xml:
    /odoo/addons/base/models/ir_ui_view.py, line 377, in _check_xml
        view_arch = etree.fromstring(view.arch.encode('utf-8'))
    AttributeError: 'bool' object has no attribute 'encode'

Now, the user will have a warning on create, to say that View Arch field is required.

Could be backported if reported

X-original-commit: 4877bb4b650f5d1c52fefb06dec2fa568afcb121
This commit is contained in:
Jeremy Kersten
2020-06-19 15:03:11 +00:00
parent d5ba35cb7c
commit adb908fb32
+1 -1
View File
@@ -30,7 +30,7 @@
<page string="Architecture" name="architecture">
<button type="object" name="open_translations"
string="Edit Translations" class="oe_link oe_right"/>
<field name="arch_base" string="View Architecture" widget="ace" options="{'mode': 'xml'}"/>
<field name="arch_base" string="View Architecture" widget="ace" options="{'mode': 'xml'}" required="1"/>
</page>
<page string="Access Rights" name="access_rights">
<field name="groups_id"/>