[IMP] lunch,web: don't disable SearchPanel on mobile
SearchPanel widget in kanban views has been introduced in commit https://github.com/odoo/odoo/pull/30517/commits/25c9355c02485e85914430188f3281246fc54cda. But this feature was disabled for mobile. This commit removes unneeded differentiation between desktop and mobile for the SearchPanel. It also adapt related tests to reflect this change. Task ID: 1917277
This commit is contained in:
@@ -29,6 +29,14 @@ QUnit.module('LunchKanbanView Mobile', {
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
'lunch.product.category': {
|
||||
fields: {},
|
||||
records: [],
|
||||
},
|
||||
'lunch.supplier': {
|
||||
fields: {},
|
||||
records: [],
|
||||
},
|
||||
'ir.model.data': {
|
||||
fields: {},
|
||||
xmlid_to_res_id() {
|
||||
@@ -51,7 +59,7 @@ QUnit.module('LunchKanbanView Mobile', {
|
||||
},
|
||||
}, function () {
|
||||
QUnit.test('basic rendering', async function (assert) {
|
||||
assert.expect(9);
|
||||
assert.expect(7);
|
||||
|
||||
const kanban = await createLunchKanbanView({
|
||||
View: LunchKanbanView,
|
||||
@@ -76,10 +84,6 @@ QUnit.module('LunchKanbanView Mobile', {
|
||||
"should have 1 records in the renderer");
|
||||
|
||||
// check view layout
|
||||
assert.containsOnce(kanban, '.o_content > div',
|
||||
"should have 1 column");
|
||||
assert.containsNone(kanban, '.o_content > div.o_search_panel',
|
||||
"shouldn't have a 'lunch filters' column");
|
||||
assert.containsOnce(kanban, '.o_content > .o_lunch_kanban',
|
||||
"should have a 'kanban lunch wrapper' column");
|
||||
assert.containsOnce(kanban, '.o_lunch_kanban > .o_kanban_view',
|
||||
|
||||
@@ -188,9 +188,7 @@ var KanbanView = BasicView.extend({
|
||||
*/
|
||||
_processNode: function (node, fv) {
|
||||
if (node.tag === 'searchpanel') {
|
||||
if (!config.device.isMobile) {
|
||||
this._processSearchPanelNode(node, fv);
|
||||
}
|
||||
this._processSearchPanelNode(node, fv);
|
||||
return false;
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
|
||||
@@ -194,34 +194,5 @@ QUnit.module('Views', {
|
||||
|
||||
kanban.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('kanban with searchpanel: there should be no searchpanel in mobile', async function (assert) {
|
||||
assert.expect(3);
|
||||
|
||||
var kanban = await createView({
|
||||
View: KanbanView,
|
||||
model: 'partner',
|
||||
data: this.data,
|
||||
arch: '<kanban>' +
|
||||
'<templates><t t-name="kanban-box">' +
|
||||
'<div>' +
|
||||
'<field name="foo"/>' +
|
||||
'</div>' +
|
||||
'</t></templates>' +
|
||||
'<searchpanel>' +
|
||||
'<field name="product_id"/>' +
|
||||
'</searchpanel>' +
|
||||
'</kanban>',
|
||||
mockRPC: function (route, args) {
|
||||
assert.step(args.method || route);
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
|
||||
assert.containsNone(kanban, '.o_search_panel');
|
||||
assert.verifySteps(['/web/dataset/search_read']);
|
||||
|
||||
kanban.destroy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user