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

. I want to fetch the data and display in xml file. I watched this video it's help me alot to fetch data but how i can display data into xml file in pivot or tree view please help me in it.​

아바타
취소

Didn't getting what you exactly want? Please describe more and update question with code that you did.

작성자

Here is the my .py file function

def get_data(self):

counting = self.env['product.brand'].search([])

for rec in counting:

print("Name", rec.name)

It's fetch list of brands which want to show in pivot view in the sale analysis section. for checking profitability report of it.

베스트 답변

Hi Muhammad if i'm right you do'nt need to create a function to get data in your report .

so wath  i think you need to do is to create only a pivot view in xml file and customize it for your research 

Example : 


<record id="view_module_pivot_" model="ir.ui.view">

            <field name="name">module.pivot</field>

            <field name="model">Module</field>

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

                <pivot string="NAME YOUR REPORT"> 

                    <field name ="Your Field" type="col"/>

                    <field name="YOUR FIELD" type="row" />

           </pivot>

       </field>

    </record>

And you need also to add pivot in your action 

<field name="view_mode">tree,pivot,graph,form,kanban</field>

아바타
취소
관련 게시물 답글 화면 활동
1
3월 20
3691
3
8월 19
9218
0
7월 19
3814
1
3월 20
8865
0
12월 19
2686