changeset 4cc6cceb9b2f in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset;node=4cc6cceb9b2f
description:
        Prevent assign unknown attributes on Model

        by adding __slots__ on PoolMeta

        issue8567
        review254091002
diffstat:

 account.py       |  2 ++
 move_template.py |  1 +
 tax.py           |  1 +
 3 files changed, 4 insertions(+), 0 deletions(-)

diffs (39 lines):

diff -r 2696175fb5ad -r 4cc6cceb9b2f account.py
--- a/account.py        Sun Aug 18 19:14:44 2019 +0200
+++ b/account.py        Sat Sep 07 23:45:08 2019 +0200
@@ -50,6 +50,7 @@
 def TypeMixin(template=False):
 
     class Mixin:
+        __slots__ = ()
         name = fields.Char('Name', required=True)
 
         statement = fields.Selection([
@@ -418,6 +419,7 @@
 def AccountMixin(template=False):
 
     class Mixin:
+        __slots__ = ()
         name = fields.Char('Name', required=True, select=True)
         code = fields.Char('Code', select=True)
 
diff -r 2696175fb5ad -r 4cc6cceb9b2f move_template.py
--- a/move_template.py  Sun Aug 18 19:14:44 2019 +0200
+++ b/move_template.py  Sat Sep 07 23:45:08 2019 +0200
@@ -362,4 +362,5 @@
 
 class CreateMoveKeywords(ModelView):
     'Create Move from Template'
+    __no_slots__ = True
     __name__ = 'account.move.template.create.keywords'
diff -r 2696175fb5ad -r 4cc6cceb9b2f tax.py
--- a/tax.py    Sun Aug 18 19:14:44 2019 +0200
+++ b/tax.py    Sat Sep 07 23:45:08 2019 +0200
@@ -1074,6 +1074,7 @@
 
 
 class TaxableMixin(object):
+    __slots__ = ()
 
     @property
     def taxable_lines(self):

Reply via email to