Skip to Content
Menu
This question has been flagged

Hi everyone

I have a question that I couldn’t find an answer to despite searching the documentation and forums, so I’m starting to wonder if it’s even possible.

Is there a way to modify the column component to add a popup that allows the user to choose how many columns to add in a form view? Or would it be better (or simpler) to create a separate component for each column layout needed?

For both approaches, I haven’t found any clear example or hint on how to implement them.

The closest I’ve gotten so far is this (see below), but it doesn't seem to have any effect on the form view:

js:
/** @odoo-module **/


import { Component, xml } from "@odoo/owl";

import { registry } from "@web/core/registry";


export class ThreeColumnsComponent extends Component {

static template = xml`

<group col="3"/>

`;

}


registry.category("studio_components").add("three_columns", {

Component: ThreeColumnsComponent,

name: "3 colonnes",

icon: "fa-columns",

type: "group",

isAvailable: (viewType) => viewType === "form",

});


xml:
<odoo>

  <template id="studio_three_columns_sidebar">

    <t t-call="web_studio.ViewEditorSidebar">

      <div class="o_web_studio_component o_web_studio_3col"

           data-type="group"

           data-col="3"

           draggable="true">

        <span>3 colonnes</span>

      </div>

    </t>

  </template>

</odoo>

Any help or guidance would be greatly appreciated!
Thanks in advance.

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 25
1169
4
May 25
1153
0
Dec 24
5686
2
Aug 25
608
1
Jul 25
1664