콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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
1167
4
5월 25
1149
0
12월 24
5684
2
8월 25
604
1
7월 25
1662