← Back to team overview

credativ team mailing list archive

[Merge] lp:~therp-nl/openupgrade-server/6.1-reverse_model_type_check into lp:openupgrade-server/6.1

 

Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/openupgrade-server/6.1-reverse_model_type_check into lp:openupgrade-server/6.1.

Requested reviews:
  OpenUpgrade Committers (openupgrade-committers)

For more details, see:
https://code.launchpad.net/~therp-nl/openupgrade-server/6.1-reverse_model_type_check/+merge/176046
-- 
https://code.launchpad.net/~therp-nl/openupgrade-server/6.1-reverse_model_type_check/+merge/176046
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~therp-nl/openupgrade-server/6.1-reverse_model_type_check into lp:openupgrade-server/6.1.
=== modified file 'openerp/modules/loading.py'
--- openerp/modules/loading.py	2012-07-17 12:14:55 +0000
+++ openerp/modules/loading.py	2013-07-21 10:34:28 +0000
@@ -172,8 +172,11 @@
         if not model._name: # new in 6.1
             return
 
-        # persistent models only
-        if isinstance(model, osv.orm.TransientModel):
+        # persistent models only. Note that transient models that
+        # inherit from persistent models cause those models to be
+        # an instance of TransientModel too (e.g. email.template)
+        # Therefore, check for a negation of Model instantion
+        if not isinstance(model, osv.orm.Model):
             return
 
         model_registry = local_registry.setdefault(


Follow ups