From a49da4d222f133a0547048ae938d698d2e64799e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 9 Jan 2008 23:51:25 +0100 Subject: [PATCH] Make inheritance be done in the __init__ function --- trytond/osv/osv.py | 16 +--------------- trytond/wizard/wizard.py | 13 +------------ 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/trytond/osv/osv.py b/trytond/osv/osv.py index 39fba2eb83..a231aad97f 100644 --- a/trytond/osv/osv.py +++ b/trytond/osv/osv.py @@ -172,21 +172,7 @@ class OSV(ORM): """ if pool.get(cls._name): parent_class = pool.get(cls._name).__class__ - nattr = {} - for i in ( - '_columns', - '_defaults', - '_inherits', - '_constraints', - '_sql_constraints', - ): - new = copy.copy(getattr(pool.get(cls._name), i)) - if hasattr(new, 'update'): - new.update(cls.__dict__.get(i, {})) - else: - new.extend(cls.__dict__.get(i, [])) - nattr[i] = new - cls = type(cls._name, (cls, parent_class), nattr) + cls = type(cls._name, (cls, parent_class), {}) obj = object.__new__(cls) obj.__init__(pool) diff --git a/trytond/wizard/wizard.py b/trytond/wizard/wizard.py index 6e40f6e60a..e35daec5e7 100644 --- a/trytond/wizard/wizard.py +++ b/trytond/wizard/wizard.py @@ -116,18 +116,7 @@ class Wizard(object): """ if pool.get(cls._name): parent_class = pool.get(cls._name).__class__ - new_states = copy.copy(getattr(pool.get(cls._name), 'states')) - for i in ( - 'actions', - 'result', - ): - new = copy.copy(getattr(new_states, i)) - if hasattr(new, 'update'): - new.update(cls.__dict__.get(i, {})) - else: - new.extend(cls.__dict__.get(i, [])) - new_states[i] = new - cls = type(cls._name, (cls, parent_class), {'states': new_states}) + cls = type(cls._name, (cls, parent_class), {}) obj = object.__new__(cls) obj.__init__(pool, pool_obj)