Files
tryton/trytond/ir/module/category.py
T
Cédric Krier 8fc4a98304 Use dict for _order on ORM object.
_order is now an instanciate variable.
It is a dict like this:
[('name', 'ASC'), ('id', 'ASC')]
2008-04-22 17:47:24 +02:00

20 lines
507 B
Python

"Category"
from trytond.osv import fields, OSV
class Category(OSV):
"Module Category"
_name = "ir.module.category"
_description = __doc__
name = fields.Char("Name", size=128, required=True)
parent = fields.Many2One('ir.module.category',
'Parent Category', select=1)
childs = fields.One2Many('ir.module.category',
'parent', 'Parent Category')
def __init__(self):
super(Category, self).__init__()
self._order.insert(0, ('name', 'ASC'))
Category()