summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-08-14 14:11:51 +0200
committerChristophe Matthieu <chm@odoo.com>2015-08-14 15:34:58 +0200
commit7c10cb47f12ea9ee5ca2dcb5b999cce11daefefc (patch)
treec2839c03cdaeeef7bfe0ef19f01fd771c2c590b2 /addons/web/static
parente0cd26376cdfd24208a1f97e88fe7912727e2f6e (diff)
[FIX] web: readonly fields not transferred from dialog to 2many field
Transfer options to 'data_create' and 'data_update' Add tour to check the fix
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/js/views/form_relational_widgets.js6
-rw-r--r--addons/web/static/test/x2many.js40
2 files changed, 42 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js
index 94fe11a5585..37c98f40077 100644
--- a/addons/web/static/src/js/views/form_relational_widgets.js
+++ b/addons/web/static/src/js/views/form_relational_widgets.js
@@ -949,7 +949,7 @@ var X2ManyViewManager = ViewManager.extend({
return self.x2m.data_create(data, options);
},
write_function: function(id, data, options) {
- return self.x2m.data_update(id, data, {}).done(function() {
+ return self.x2m.data_update(id, data, options).done(function() {
self.x2m.reload_current_view();
});
},
@@ -1113,8 +1113,8 @@ var One2ManyListView = X2ManyListView.extend({
res_id: id,
context: self.x2m.build_context(),
title: _t("Open: ") + self.x2m.string,
- write_function: function(id, data) {
- return self.x2m.data_update(id, data, {}).done(function() {
+ write_function: function(id, data, options) {
+ return self.x2m.data_update(id, data, options).done(function() {
self.x2m.reload_current_view();
});
},
diff --git a/addons/web/static/test/x2many.js b/addons/web/static/test/x2many.js
index 908ef239577..bb6c1918932 100644
--- a/addons/web/static/test/x2many.js
+++ b/addons/web/static/test/x2many.js
@@ -224,7 +224,7 @@ Tour.register({
// change message a
{
- title: "create new message aaa",
+ title: "edit message a",
waitNot: '.modal',
waitFor: '.oe_list_field_cell:containsExact(e)',
element: '.oe_list_field_cell:containsExact(a)'
@@ -240,6 +240,44 @@ Tour.register({
element: '.o_formdialog_save'
},
+ // change message e
+
+ {
+ title: "edit message e",
+ waitNot: '.modal',
+ waitFor: '.oe_list_field_text:contains(aaa)',
+ element: '.oe_list_field_cell:containsExact(e)'
+ },
+
+ {
+ title: "open the many2one to select an other user",
+ element: '.modal .oe_m2o_drop_down_button',
+ },
+ {
+ title: "select an other user",
+ element: '.ui-autocomplete li:contains(Demo User)',
+ },
+ {
+ title: "test one2many's line onchange after many2one",
+ waitFor: '.oe_form_char_content:contains([test_trigger] Demo User)',
+ },
+ {
+ title: "test one2many field not triggered onchange",
+ waitFor: 'textarea[name="message_concat"]:propValueContains([test_trigger] Administrator:e)',
+ },
+ {
+ title: "save changes",
+ element: '.o_formdialog_save'
+ },
+ {
+ title: "test one2many triggered the onchange on save for the line",
+ waitFor: '.oe_list_content td.oe_list_field_cell.oe_readonly:contains([test_trigger] Demo User)',
+ },
+ {
+ title: "test one2many triggered the onchange on save",
+ waitFor: 'textarea[name="message_concat"]:propValueContains([test_trigger] Demo User:e)',
+ },
+
// remove
{