mirror of https://github.com/OCA/web.git
[FIX] web_widget_x2many_2d_matrix: Force render in list mode on mobile
parent
8f1db7f5fa
commit
337a2b72af
|
@ -168,6 +168,8 @@ Known issues / Roadmap
|
||||||
|
|
||||||
* Support extra invisible fields inside each cell.
|
* Support extra invisible fields inside each cell.
|
||||||
|
|
||||||
|
* Support kanban mode. Current behaviour forces list mode.
|
||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
|
|
@ -12,3 +12,5 @@
|
||||||
is merged.
|
is merged.
|
||||||
|
|
||||||
* Support extra invisible fields inside each cell.
|
* Support extra invisible fields inside each cell.
|
||||||
|
|
||||||
|
* Support kanban mode. Current behaviour forces list mode.
|
||||||
|
|
|
@ -526,6 +526,7 @@ to click on m2o to open related records.</li>
|
||||||
will enter into the 1st cell until <a class="reference external" href="https://github.com/odoo/odoo/pull/26490">https://github.com/odoo/odoo/pull/26490</a>
|
will enter into the 1st cell until <a class="reference external" href="https://github.com/odoo/odoo/pull/26490">https://github.com/odoo/odoo/pull/26490</a>
|
||||||
is merged.</li>
|
is merged.</li>
|
||||||
<li>Support extra invisible fields inside each cell.</li>
|
<li>Support extra invisible fields inside each cell.</li>
|
||||||
|
<li>Support kanban mode. Current behaviour forces list mode.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="changelog">
|
<div class="section" id="changelog">
|
||||||
|
|
|
@ -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);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
<template id="assets_backend" name="web_widget_x2many_2d_matrix assets" inherit_id="web.assets_backend">
|
<template id="assets_backend" name="web_widget_x2many_2d_matrix assets" inherit_id="web.assets_backend">
|
||||||
<xpath expr="." position="inside">
|
<xpath expr="." position="inside">
|
||||||
|
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/2d_matrix_view.js" />
|
||||||
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js" />
|
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js" />
|
||||||
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/widget_x2many_2d_matrix.js" />
|
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/widget_x2many_2d_matrix.js" />
|
||||||
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/abstract_view_matrix_limit_extend.js" />
|
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/abstract_view_matrix_limit_extend.js" />
|
||||||
|
|
Loading…
Reference in New Issue