mirror of
https://github.com/bringout/oca-web.git
synced 2026-04-20 10:12:02 +02:00
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
21 lines
924 B
JavaScript
21 lines
924 B
JavaScript
/** @odoo-module **/
|
|
/* Copyright 2023 Moduon Team S.L.
|
|
* License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) */
|
|
|
|
import {FormController} from "@web/views/form/form_controller";
|
|
import {patch} from "@web/core/utils/patch";
|
|
import {hasTouch} from "@web/core/browser/feature_detection";
|
|
|
|
patch(FormController.prototype, "web_touchscreen.FormController", {
|
|
setup() {
|
|
const wasSmall = this.env.isSmall;
|
|
// Create a new env that extends the original one but overrides the way
|
|
// Odoo considers this device small: it will be small if it has touch
|
|
// capabilities, not only if the screen is small. In practice, this
|
|
// will make the inline subforms prefer the kanban mode if possible.
|
|
const newEnv = {isSmall: wasSmall || hasTouch()};
|
|
Object.setPrototypeOf(newEnv, this.env);
|
|
this.env = newEnv;
|
|
return this._super(...arguments);
|
|
},
|
|
});
|