Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Odoo HIERARCHICAL VIEW v 8

By
Da3oub
on 6/9/16, 4:33 AM 327 views

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.

Pascal Tremblay
on 9/2/16, 5:27 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/9/16, 4:33 AM
Seen: 327 times
Last updated: 9/2/16, 5:27 PM