Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3269 มุมมอง

I'm trying to create my own custom module for the products category with a hierarchical view.

My main requirement that i'll be able to create a view with folds , unfold capability. Here's an example:

|Category Root (UNFolded)

     |Category A  (UNFolded)

             |Sub Category A1

     |Category B (UnFolded)

             |Sub Category B1

             |Sub Category B2

             |Sub Category B3

     |Category C (Folded)

-----------------------------

If i click on category C Row I ll be Able to unfold it and see it's sub category.


My first Attempt

class odepoCategory(models.Model):

_name = 'odepo.category'

nomCategory = fields.Char(string='Nom Category')

parentCategory = fields.Many2one('odepo.category', string='Super Category')

subCategories = fields.One2many('odepo.category', 'parentCategory', string='Sous Categories')


Howerver i don't have a clue on how to show the hierarchical view.


     

อวตาร
ละทิ้ง

Trying the same thing here. I want the same hierarchical view in product categories than in the chart of accounts view.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ต.ค. 15
5463
Select multiple elements with XPath แก้ไขแล้ว
5
ส.ค. 24
46867
0
เม.ย. 24
1877
4
พ.ย. 23
5992
0
ต.ค. 23
1741