mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_widget_x2many_2d_matrix: Force render in list mode on mobile
This commit is contained in:
committed by
Lois Rilo
parent
8f1db7f5fa
commit
337a2b72af
23
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_view.js
Normal file
23
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_view.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Copyright 2019 Alexandre Díaz
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
||||
|
||||
odoo.define('web_widget_x2many_2d_matrix.X2Many2dMatrixView', function (require) {
|
||||
"use strict";
|
||||
|
||||
var BasicView = require('web.BasicView');
|
||||
|
||||
BasicView.include({
|
||||
_processField: function (viewType, field, attrs) {
|
||||
// Workaround for kanban mode rendering.
|
||||
// Source of the issue: https://github.com/OCA/OCB/blob/12.0/addons/web/static/src/js/views/basic/basic_view.js#L303 .
|
||||
// See https://github.com/OCA/web/pull/1404#pullrequestreview-305813206 .
|
||||
// In the long term we should a way to handle kanban mode
|
||||
// better (eg: a specific renderer).
|
||||
if (attrs.widget === 'x2many_2d_matrix') {
|
||||
attrs.mode = 'tree';
|
||||
}
|
||||
return this._super(viewType, field, attrs);
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user