pshung29 / turbocare

Automatically exported from code.google.com/p/turbocare
0 stars 0 forks source link

Giving error while New sub-item create (Inv catalog item) #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
System is not accepting New Inventory catalog Item (item master).
Error as follows:
500 Internal error

The server encountered an unexpected condition which prevented it from
fulfilling the request.

Page handler: <function _wrapper at 0x2aaaaad40f50>
Traceback (most recent call last):
  File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools
.py",
line 105, in _run
    self.main()
  File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools
.py",
line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/identity
/conditions.py",
line 275, in _wrapper
    return fn( *args, **kw )
  File "<string>", line 3, in CatalogItemsEditorSave
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/controll
ers.py",
line 334, in expose
    output = database.run_with_transaction(
  File "<string>", line 5, in run_with_transaction
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/database
.py",
line 245, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/controll
ers.py",
line 351, in <lambda>
    mapping, fragment, args, kw)))
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/controll
ers.py",
line 378, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/errorhan
dling.py",
line 71, in try_call
    return func(self, *args, **kw)
  File "<string>", line 3, in CatalogItemsEditorSave
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/controll
ers.py",
line 173, in validate
    return errorhandling.run_with_errors(errors, func, *args, **kw)
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/errorhan
dling.py",
line 106, in run_with_errors
    return func(self, *args, **kw)
  File "<string>", line 3, in CatalogItemsEditorSave
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/identity
/conditions.py",
line 235, in require
    return fn(self, *args, **kwargs)
  File "/home/me/svn/turbocare/turbocare/controllers_store.py", line 301,
in CatalogItemsEditorSave

Tax=Tax,ParentItemID=ParentItemID,CompoundID=CompoundID,PackagingID=PackagingID)
  File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/declarativ
e.py",
line 93, in _wrapper
    return fn(self, *args, **kwargs)
  File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/main.py",
line 1203, in __init__
    self._create(id, **kw)
  File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/main.py",
line 1227, in _create
    self.set(**kw)
  File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/main.py",
line 1105, in set
    raise AttributeError, '%s (with attribute %r)' % (e, name)
AttributeError: 'InvCatalogItem' object has no attribute 'id' (with
attribute 'ParentItemID')

What is the expected output? What do you see instead?
New Item entry should accept under main catalog or sub catalog groups.

What version of the product are you using? On what operating system?
174 

Please provide any additional information below.

File "<string>", line 3, in CatalogItemsEditorSave
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/controll
ers.py",
line 173, in validate
    return errorhandling.run_with_errors(errors, func, *args, **kw)
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/errorhan
dling.py",
line 106, in run_with_errors
    return func(self, *args, **kw)
  File "<string>", line 3, in CatalogItemsEditorSave
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b2-py2.4.egg/turbogears/identity
/conditions.py",
line 235, in require
    return fn(self, *args, **kwargs)
  File "/home/me/svn/turbocare/turbocare/controllers_store.py", line 301,
in CatalogItemsEditorSave

Tax=Tax,ParentItemID=ParentItemID,CompoundID=CompoundID,PackagingID=PackagingID)
  File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/declarativ
e.py",
line 93, in _wrapper
    return fn(self, *args, **kwargs)
  File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/main.py",
line 1203, in __init__
    self._create(id, **kw)
  File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/main.py",
line 1227, in _create
    self.set(**kw)
  File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/main.py",
line 1105, in set
    raise AttributeError, '%s (with attribute %r)' % (e, name)
AttributeError: 'InvCatalogItem' object has no attribute 'id' (with
attribute 'ParentItemID')
Request Headers:
  REFERER:
http://localhost:8080/hospital_site_store/CatalogItemsEditor?CatalogItemID=423
  Content-Length: 266
  ACCEPT-CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  USER-AGENT: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.1)
Gecko/20060601 Firefox/2.0.0.1 (Ubuntu-edgy)
  CONNECTION: keep-alive
  COOKIE: TurboCare=401cda6ab499c19d14fdc82ace47db05ec30d2f2;
session_id=d446b8362dd533d06704f193041f55f61d60ad8a
  CONTENT-LENGTH: 266
  HOST: localhost:8080
  CONTENT-TYPE: application/x-www-form-urlencoded
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,
image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type: application/x-www-form-urlencoded
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - tushar "POST /hospital_site_store/CatalogItemsEditorSave
HTTP/1.1" 500 3778
"http://localhost:8080/hospital_site_store/CatalogItemsEditor?CatalogItemID=423"
"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.1) Gecko/20060601
Firefox/2.0.0.1 (Ubuntu-edgy)"

Original issue reported on code.google.com by tushar.c...@gmail.com on 31 Jan 2007 at 11:47

GoogleCodeExporter commented 8 years ago
The problem appears to lie in model_inventory.py in the "def 
_set_ParentItemID(self,
value):" function.  I have commented out this function for now until Wes has a 
chance
to look at it.  

The code responsible for the error is as follows
        def _set_ParentItemID(self, value):
                if value==self.id:
                       if self.ParentItemID==self.id:
                               value = None
                       else:
                               value = self.ParentItemID
                value = self.ParentItemID
               self._SO_set_ParentItemID(value)   
I believe that this code was meant to provide some extra error checking for
ParentItemID but I suspect self.id does not exist when creating new catalogue 
items.

Original comment by oneg...@gmail.com on 1 Feb 2007 at 8:43

GoogleCodeExporter commented 8 years ago
Thanks Dave.  The code causing the problem will need more checks to make sure 
that it
isn't a new item being added.

Original comment by umpen...@gmail.com on 1 Feb 2007 at 10:47

GoogleCodeExporter commented 8 years ago
I've tried a few things to make the code check work, but I haven't found a way 
that
works.  I'll leave the checks in the section of code that does the saving and 
leave
the SQLObject as is (with the check commented out).

If there are no objections, I'll leave this one closed, and move on to other
troubling issues.

Original comment by umpen...@gmail.com on 13 Feb 2007 at 1:08