İçereği Atla
Menü
Bu soru işaretlendi
170 Görünümler

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Nis 25
1173
4
May 25
1155
0
Ara 24
5686
2
Ağu 25
612
1
Tem 25
1670