Warehouse Address:
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index 3b6ec4d794c..7f3562571f2 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -1128,10 +1128,11 @@ instance.web.Sidebar = instance.web.Widget.extend({
new instance.web.Dialog(this, { title: _t("Warning"), size: 'medium',}, $("
").text(_t("You must choose at least one record."))).open();
return false;
}
+ var dataset = self.getParent().dataset;
var active_ids_context = {
active_id: ids[0],
active_ids: ids,
- active_model: self.getParent().dataset.model,
+ active_model: dataset.model,
};
$.when(domain).done(function (domain) {
@@ -1145,7 +1146,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
self.rpc("/web/action/load", {
action_id: item.action.id,
context: new instance.web.CompoundContext(
- self.dataset.get_context(), active_ids_context).eval()
+ dataset.get_context(), active_ids_context).eval()
}).done(function(result) {
result.context = new instance.web.CompoundContext(
result.context || {}, active_ids_context)
diff --git a/openerp/addons/test_new_api/tests/test_onchange.py b/openerp/addons/test_new_api/tests/test_onchange.py
index e9b7e1f83aa..3d0745a5f8b 100644
--- a/openerp/addons/test_new_api/tests/test_onchange.py
+++ b/openerp/addons/test_new_api/tests/test_onchange.py
@@ -146,8 +146,6 @@ class TestOnChange(common.TransactionCase):
}),
(1, message.id, {
'name': "[%s] %s" % ("Foo", USER.name),
- # Note: size is computed because it was not provided beforehand
- 'size': len(BODY),
}),
])
diff --git a/openerp/models.py b/openerp/models.py
index 83103617b57..cff7e390251 100644
--- a/openerp/models.py
+++ b/openerp/models.py
@@ -5793,6 +5793,11 @@ class BaseModel(object):
# attach `self` with a different context (for cache consistency)
record._origin = self.with_context(__onchange=True)
+ # load fields on secondary records, to avoid false changes
+ with env.do_in_onchange():
+ for field_seq in secondary:
+ record.mapped(field_seq)
+
# determine which field(s) should be triggered an onchange
todo = list(names) or list(values)
done = set()