← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 625896] Re: exception if fields.py if no _context

 

** Branch linked: lp:openobject-server

-- 
exception if fields.py if no _context
https://bugs.launchpad.net/bugs/625896
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.

Status in OpenObject Server: Fix Released

Bug description:
I made this change some time ago, and no longer have the traceback.

An exception is thrown in osv/fields.py if self._context is False

The following change fixes the problem:


=== modified file 'bin/osv/fields.py'
--- bin/osv/fields.py   2010-08-13 00:23:21 +0000
+++ bin/osv/fields.py   2010-08-20 18:52:39 +0000
@@ -428,7 +428,10 @@
             context = {}
         if self._context:
             context = context.copy()
-        context.update(self._context)
+        try:
+            context.update(self._context)
+        except:
+            pass
          if not values:
            values = {}

Revision is 2572, trunk