Přejít na obsah
Menu
You need to be registered to interact with the community.
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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
dub 25
1174
4
kvě 25
1156
0
pro 24
5686
2
srp 25
613
1
čvc 25
1672