summaryrefslogtreecommitdiff
path: root/odoo/addons/test_testing_utilities/ir.model.access.csv
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-01-09 12:14:27 +0000
committerXavier Morel <xmo@odoo.com>2020-01-13 16:24:17 +0000
commit9d74b1f73a92b9030438f590f729bb7866cba191 (patch)
tree01c83948fe32241cfc3b3bb8b6899665c70d71f0 /odoo/addons/test_testing_utilities/ir.model.access.csv
parentba69b1d534883960dceb49ed558d3a4229864e97 (diff)
[FIX] core: saving of o2m value init'd via onchange
In the SSF, o2m updates get initialized with no values (1, id, {}). The record data is only fetched when the "record" gets updated explicitly from which updates will hopefully get properly tracked & saved. However if the "record" was first initialized through an onchange values which are updated by the onchange (diverging from the db) those would not get tracked and thus wouldn't get saved when the record is saved. * use more specific placeholder (None) for "o2m records to update but we don't have values yet" * once we have values, always store them as an update-tracking dict * if we don't have values yet for an o2m and an onchange is trying to write to it, initialize with values from database first (might eventually be a good idea to initialize upfront though there's the question of what happens for default values and recursive views) * mark anything coming back from the onchange and differing from local values as changed (so they get sent out on save) * properly reify parent values for onchange instead of sending them as-is * the evaluation context for contexts (and domains) needs properly formatted values so use `_values_to_save` to get them, however it cares about neither required-ing nor filtering out e.g. unmodified fields, therefore add an awful toggle to handle this Task 2150302 Probably todo in the future: * better UI for change-tracking dict, should have "snapshot" support (to freeze / discard previous changes) * cleanup save, it's unclear that it properly resets the form closes odoo/odoo#43235 X-original-commit: 6c99fe3ffec3aeb8d210e3b943ccef81d62d44ce Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'odoo/addons/test_testing_utilities/ir.model.access.csv')
-rw-r--r--odoo/addons/test_testing_utilities/ir.model.access.csv2
1 files changed, 2 insertions, 0 deletions
diff --git a/odoo/addons/test_testing_utilities/ir.model.access.csv b/odoo/addons/test_testing_utilities/ir.model.access.csv
index 1cb9a9f542a..2e7786fdcc4 100644
--- a/odoo/addons/test_testing_utilities/ir.model.access.csv
+++ b/odoo/addons/test_testing_utilities/ir.model.access.csv
@@ -20,3 +20,5 @@ access_test_testing_utilities_onchange_count_sub,access_test_testing_utilities_o
access_o2m_readonly_subfield_parent,access_o2m_readonly_subfield_parent,model_o2m_readonly_subfield_parent,,1,1,1,1
access_o2m_readonly_subfield_child,access_o2m_readonly_subfield_child,model_o2m_readonly_subfield_child,,1,1,1,1
access_test_testing_utilities_req_bool,access_test_testing_utilities_req_bool,model_test_testing_utilities_req_bool,,1,0,0,0
+access_o2m_changes_children,access_o2m_changes_children,model_o2m_changes_children,base.group_user,1,0,0,0
+access_o2m_changes_children_lines,access_o2m_changes_children_lines,model_o2m_changes_children_lines,base.group_user,1,0,0,0