[FIX] web, mail: complete commit https://github.com/odoo/odoo/commit/87f1e360a89eb7617d5fd60cad58a143bea441df
Tests are overridding the `config` object directly but this was wrongly done. Also, tests had to be adapted to set the `isMobile` value correctly.
This commit is contained in:
@@ -22,9 +22,7 @@ QUnit.module('Discuss client action', {
|
||||
archs: {
|
||||
'mail.message,false,search': '<search/>',
|
||||
},
|
||||
config: {
|
||||
isMobile: true
|
||||
},
|
||||
config: {device: {isMobile: true}},
|
||||
});
|
||||
var chatAction = new ChatAction(parent, params);
|
||||
chatAction.set_cp_bus(new Widget());
|
||||
@@ -51,9 +49,7 @@ QUnit.skip('mobile basic rendering', function (assert) {
|
||||
archs: {
|
||||
'mail.message,false,search': '<search/>',
|
||||
},
|
||||
config: {
|
||||
isMobile: true,
|
||||
},
|
||||
config: {device: {isMobile: true}},
|
||||
});
|
||||
|
||||
var params = {
|
||||
|
||||
@@ -6939,9 +6939,7 @@ QUnit.module('relational_fields', {
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
res_id: 1,
|
||||
config: {
|
||||
isMobile: false,
|
||||
},
|
||||
config: {device: {isMobile: false}},
|
||||
});
|
||||
|
||||
assert.strictEqual(count, 1, 'once search_read should have been done to fetch the relational values');
|
||||
@@ -6990,9 +6988,7 @@ QUnit.module('relational_fields', {
|
||||
'<header><field name="trululu" widget="statusbar" clickable="True"/></header>' +
|
||||
'</form>',
|
||||
res_id: 1,
|
||||
config: {
|
||||
isMobile: false,
|
||||
},
|
||||
config: {device: {isMobile: false}},
|
||||
});
|
||||
|
||||
var $selectedStatus = form.$('.o_statusbar_status button[data-value="4"]');
|
||||
@@ -7021,9 +7017,7 @@ QUnit.module('relational_fields', {
|
||||
'<header><field name="product_id" widget="statusbar"/></header>' +
|
||||
'</form>',
|
||||
res_id: 1,
|
||||
config: {
|
||||
isMobile: false,
|
||||
},
|
||||
config: {device: {isMobile: false}},
|
||||
});
|
||||
|
||||
assert.ok(form.$('.o_statusbar_status').hasClass('o_field_empty'),
|
||||
@@ -7046,9 +7040,7 @@ QUnit.module('relational_fields', {
|
||||
'<form string="Partners">' +
|
||||
'<header><field name="trululu" widget="statusbar"/></header>' +
|
||||
'</form>',
|
||||
config: {
|
||||
isMobile: false,
|
||||
},
|
||||
config: {device: {isMobile: false}},
|
||||
});
|
||||
|
||||
assert.strictEqual(form.$('.o_statusbar_status button:disabled').length, 2, "should have 2 status");
|
||||
@@ -7070,9 +7062,7 @@ QUnit.module('relational_fields', {
|
||||
'<header><field name="trululu" widget="statusbar" clickable="True"/></header>' +
|
||||
'</form>',
|
||||
res_id: 1,
|
||||
config: {
|
||||
isMobile: false,
|
||||
},
|
||||
config: {device: {isMobile: false}},
|
||||
});
|
||||
|
||||
form.$buttons.find('.o_form_button_edit').click();
|
||||
@@ -7101,9 +7091,7 @@ QUnit.module('relational_fields', {
|
||||
'<field name="color" widget="statusbar" statusbar_visible="red"/></header>' +
|
||||
'</form>',
|
||||
res_id: 1,
|
||||
config: {
|
||||
isMobile: false,
|
||||
},
|
||||
config: {device: {isMobile: false}},
|
||||
});
|
||||
|
||||
form.$buttons.find('.o_form_button_edit').click();
|
||||
@@ -7138,9 +7126,7 @@ QUnit.module('relational_fields', {
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
res_id: 1,
|
||||
config: {
|
||||
isMobile: false,
|
||||
},
|
||||
config: {device: {isMobile: false}},
|
||||
});
|
||||
|
||||
form.$buttons.find('.o_form_button_edit').click();
|
||||
|
||||
@@ -272,8 +272,14 @@ function addMockEnvironment(widget, params) {
|
||||
_.extend(session, params.session);
|
||||
}
|
||||
if ('config' in params) {
|
||||
initialConfig = _.extend({}, config);
|
||||
_.extend(config, params.config);
|
||||
initialConfig = _.clone(config);
|
||||
initialConfig.device = _.clone(config.device);
|
||||
if ('device' in params.config) {
|
||||
_.extend(config.device, params.config.device);
|
||||
}
|
||||
if ('debug' in params.config) {
|
||||
config.debug = params.config.debug;
|
||||
}
|
||||
}
|
||||
if ('translateParameters' in params) {
|
||||
initialParameters = _.extend({}, core._t.database.parameters);
|
||||
|
||||
@@ -2116,9 +2116,7 @@ QUnit.module('Views', {
|
||||
'</t></templates>' +
|
||||
'</kanban>',
|
||||
groupBy: ['product_id'],
|
||||
config: {
|
||||
isMobile: true
|
||||
}
|
||||
config: {device: {isMobile: true}},
|
||||
}).then(function (kanban) {
|
||||
|
||||
// Dummy dom update trigger for activate mobile tabs and move to first column
|
||||
|
||||
Reference in New Issue
Block a user