跳至內容
選單
此問題已被標幟

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.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
4月 25
1172
4
5月 25
1153
0
12月 24
5686
2
8月 25
609
1
7月 25
1664