[IMP] product: stricter documents creation

Do not allow modifying documents types, correctly mark necessary fields
as required, ...

Part-of: odoo/odoo#135894
This commit is contained in:
Victor Feyens
2023-09-21 18:27:47 +00:00
parent 83ab6a87d2
commit 087ff42e3a
@@ -12,9 +12,9 @@
<field name="name" readonly="not datas and type != 'url'"/>
</h1>
<group>
<field name="type"/>
<field name="datas" filename="name" invisible="type == 'url'"/>
<field name="url" widget="url" invisible="type == 'binary'"/>
<field name="type" readonly="datas or id"/>
<field name="datas" filename="name" invisible="type == 'url'" required="type == 'binary'"/>
<field name="url" widget="url" invisible="type == 'binary'" required="type == 'url'"/>
</group>
<group string="Attached To" groups="base.group_no_one">
<field name="res_name"/>