3
0
Fork 0

[FIX] web_widget_x2many_2d_matrix: Force render in list mode on mobile

17.0
Alexandre Díaz 2019-10-14 13:25:43 +02:00 committed by SodexisTeam
parent ca1cffb64b
commit 0188fd9d76
5 changed files with 29 additions and 0 deletions

View File

@ -168,6 +168,8 @@ Known issues / Roadmap
* Support extra invisible fields inside each cell.
* Support kanban mode. Current behaviour forces list mode.
Changelog
=========

View File

@ -12,3 +12,5 @@
is merged.
* Support extra invisible fields inside each cell.
* Support kanban mode. Current behaviour forces list mode.

View File

@ -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>
is merged.</li>
<li>Support extra invisible fields inside each cell.</li>
<li>Support kanban mode. Current behaviour forces list mode.</li>
</ul>
</div>
<div class="section" id="changelog">

View 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);
},
});
});

View File

@ -6,6 +6,7 @@
<template id="assets_backend" name="web_widget_x2many_2d_matrix assets" inherit_id="web.assets_backend">
<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/widget_x2many_2d_matrix.js" />
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/abstract_view_matrix_limit_extend.js" />