← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 753337] [NEW] [5.0] document_file create

 

Public bug reported:

In openERP 5.0.10 file bin/addons/portal_project/portal_project.py

Line 108 the following code is wrong:
if args[0]['default_res_id'] and args[0]['default_res_model'] == 'project.project':

As per python manual http://docs.python.org/library/stdtypes.html#typesmapping :
d[key]
    Return the item of d with key key. Raises a KeyError if key is not in the map.

So the test will raise an error if default_res_id doesn't exist. It should be changed to:
 key in d
    Return True if d has a key key, else False.

That is, the line of code should be:
 if 'default_res_id' in args[0] and args[0]['default_res_model'] == 'project.project':

Kind regards

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/753337

Title:
  [5.0] document_file create

Status in OpenERP Server:
  New

Bug description:
  In openERP 5.0.10 file bin/addons/portal_project/portal_project.py

  Line 108 the following code is wrong:
  if args[0]['default_res_id'] and args[0]['default_res_model'] == 'project.project':

  As per python manual http://docs.python.org/library/stdtypes.html#typesmapping :
  d[key]
      Return the item of d with key key. Raises a KeyError if key is not in the map.

  So the test will raise an error if default_res_id doesn't exist. It should be changed to:
   key in d
      Return True if d has a key key, else False.

  That is, the line of code should be:
   if 'default_res_id' in args[0] and args[0]['default_res_model'] == 'project.project':

  Kind regards



Follow ups

References