Steps to reproduce
==================
1. Install event
2. Go to Events
3. Configuration > Event Templates
4. Click on any event
5. Click on Communication
6. Add a line, change type to SMS
7. Type anything in Template
8. Click on Create "..."
9. The operation cannot be completed
Cause of the issue
==================
For many2one and many2many editable fields, the server sets the
can_create and can_write attributes on the field nodes. [1][2]
In some cases [3], those attributes are missing even though the fields
are actually editable. They are also absent for reference fields.
The `canQuickCreate` props was set to the following value:
`canCreate && !noQuickCreate`. When canCreate was absent, this was
evaluated to undefined, thus ignoring the noQuickCreate option.
Solution
========
When the permission attributes are missing, we have to assume that the
user has the appropriate permissions.
We also have to cast the extracted props to booleans as if you have an
props with a value of undefined, it will fall back to the default value.
In the test `no_quick_create option on a many2one when can_create is absent`,
we set the field as readonly and then cancel the readonly on the view.
This reproduces one of the bug of [3] which causes the permission
attributes to be missing.
-----
[1]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1296-L1297
[2]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1080-L1086
[3]: https://github.com/odoo/odoo/pull/138032
opw-3609799
closesodoo/odoo#148163
X-original-commit: efcb2a820bb57f1fae809725e799b3145fbbe599
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>