[FIX] base, contact: add conditions in Set Defaults form

Version: only V16.0 (will be improve in future versions)

Steps to reproduce:
    - install the "contacts" module;
    - go to a contact;
    - go to the "Set Defaults" tab (in the debug menu).

Issue:
    There is no field that allows you to select the condition.

Cause:
    The function `getConditions` needs the `change_default` attribute of the field.

Solution:
    Add the `change_default` attribute to the list which is returned by the `_get_view_field_attributes` function.

opw-3079328

closes odoo/odoo#106410

X-original-commit: 07315bee24f69e2b9a1004d33eab842a8929709d
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
This commit is contained in:
Thomas Lefebvre (thle)
2022-11-24 13:29:05 +01:00
parent c23bbf30c8
commit bd235e57cc
2 changed files with 6 additions and 2 deletions
@@ -39,6 +39,10 @@ odoo.define('debug_menu_set_defaults.tour', function (require) {
element_field.dispatchEvent(new Event("change"));
},
},
{
content: "Check that there are conditions",
trigger: '#formview_default_conditions',
},
{
content: "Save the new default",
trigger: 'footer button:contains(Save default)',
+2 -2
View File
@@ -2695,8 +2695,8 @@ class Model(models.AbstractModel):
:rtype: list
"""
return [
'context', 'currency_field', 'definition_record', 'digits', 'domain', 'group_operator', 'groups', 'help',
'name', 'readonly', 'related', 'relation', 'relation_field', 'required', 'searchable', 'selection', 'size',
'change_default', 'context', 'currency_field', 'definition_record', 'digits', 'domain', 'group_operator', 'groups',
'help', 'name', 'readonly', 'related', 'relation', 'relation_field', 'required', 'searchable', 'selection', 'size',
'sortable', 'store', 'string', 'translate', 'trim', 'type',
]