Define metaclass at class level

This commit is contained in:
Guillem Barba 2016-04-14 01:05:40 +02:00
parent 6a52824040
commit c7ed1a2aef
1 changed files with 3 additions and 5 deletions

View File

@ -3,21 +3,19 @@
from trytond.model import ModelView, ModelSQL, fields
from trytond.pool import PoolMeta
__all__ = ['Brand', 'Template']
__metaclass__ = PoolMeta
from trytond.modules.product.product import STATES, DEPENDS
__all__ = ['Brand', 'Template']
class Brand(ModelSQL, ModelView):
'''Brand'''
__name__ = 'product.brand'
name = fields.Char('Name', required=True)
class Template:
__name__ = 'product.template'
__metaclass__ = PoolMeta
brand = fields.Many2One('product.brand', 'Brand', states=STATES,
depends=DEPENDS)