Prevent assign unknown attributes on Model

by adding __slots__ on PoolMeta

issue8567
review254091002
This commit is contained in:
Cédric Krier
2019-09-07 23:45:08 +02:00
parent 43628b852c
commit 63deb9e352
+2
View File
@@ -10,6 +10,7 @@ __all__ = ['ClassificationMixin', 'classification_tree',
class ClassificationMixin(DeactivableMixin):
__slots__ = ()
name = fields.Char('Name', translate=True, required=True)
selectable = fields.Boolean('Selectable', select=True)
@@ -22,6 +23,7 @@ def classification_tree(name):
'Return a ClassificationMixin with tree structure'
class ClassificationTreeMixin(tree(separator=' / '), ClassificationMixin):
__slots__ = ()
parent = fields.Many2One(name, 'Parent', select=True)
childs = fields.One2Many(name, 'parent', 'Children')