[FIX] web: FormView: add o_xxs_form_view className on small screens

The form view is styled differently on small screens, and those rules
are based on the presence of the "o_xxs_form_view" className. This
commit correctly toggles it.

Part-of: odoo/odoo#78221
This commit is contained in:
Samuel Degueldre
2022-07-22 16:21:40 +02:00
committed by Géry Debongnie
parent 6a73b3e7ff
commit 7ff03baca2
2 changed files with 8 additions and 1 deletions
@@ -410,6 +410,13 @@ export class FormController extends Component {
translateAlertData: toRaw(this.translateAlertData),
};
}
get className() {
return {
[this.props.className]: true,
o_xxs_form_view: this.env.isSmall,
};
}
}
FormController.template = `web.FormView`;
@@ -2,7 +2,7 @@
<templates xml:space="preserve">
<t t-name="web.FormView" owl="1">
<div t-att-class="props.className" t-ref="root">
<div t-att-class="className" t-ref="root">
<Layout className="model.useSampleModel ? 'o_view_sample_data' : ''">
<t t-if="showingTranslateAlert[model.root.resId]" t-call="web.TranslateAlert" />
<t t-set-slot="layout-buttons">