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

Hi,


I'd like to know how widgets such as monetary​ or float_time​ can be applied to measure fields when creating a pivot view.


I only learned how to apply a widget in a form view inside <field name=...>. Also I can generate a pivot view action object in model (in Python) and providing context such as pivot_row_groupby​ or pivot_measures​.


Thank you.

아바타
취소
작성자

Hi Desk,


That's the first thing that I tried. It didn't change anything, and I couldn't find a developer documentation on pivot views, so that's why posted the question.

If that's how simple it's supposed to work, I'm afraid it's another issue with my local settings.


Also how would I achieve widget="..."​ in providing context as in 'pivot_measures': 'field_name'​? like 'pivot_measures': 'field_name:widget_name'​?


Which version are you using?

작성자

@Desk Enterprise,

It's 18.0 Community Edition.

베스트 답변

Hii,

Define the Widget in the Pivot View XML

Inside the <pivot> view definition, you define measure fields using <field name="..." widget="..."/>.

🧾 Example: Pivot View with monetary and float_time
<record id="my_model_pivot_view" model="ir.ui.view">

  <field name="name">my.model.pivot</field>

  <field name="model">my.model</field>

  <field name="arch" type="xml">

    <pivot string="My Model Analysis">

      <!-- Group-by field -->

      <field name="state"/>

     

      <!-- Measures with widgets -->

      <field name="amount_total" type="measure" widget="monetary"/>

      <field name="duration_hours" type="measure" widget="float_time"/>

    </pivot>

  </field>

</record>

i hope it is use full

아바타
취소
관련 게시물 답글 화면 활동
1
7월 24
29
1
7월 24
1757
2
8월 23
1915
1
7월 23
4218
0
3월 24
3226