Define metaclass at class level
This commit is contained in:
parent
6a52824040
commit
c7ed1a2aef
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue